I am new to programming and I am trying to solve my first big problem and write my first big program. I have looked for open source examples of code to learn from, but so far have only found code in languages I don't fully understand or that does related but still-too-distant things for me to really learn from. I am having trouble taking some conceptual steps here.

I want make a simple piece of software to build, modify, and later represent small organic molecules. This is mainly a learning exercise. A user would give a SMILES string or choose from a basic set of starter molecules, and then could build on that molecule either graphically or via a text input syntax. However, I am not even at that point of complexity yet. I can't even fully comprehend how to make classes/object to store the molecules. So, my question succinctly: How do I use classes/objects to build molecules while retaining all levels of information, and what data structures should I use as attributes to which objects? And, can objects be attributes to other objects?

Here is my train of thought so far: I was thinking to have a "Molecule" class, then a "Atom" class/subclass and a "Bond" subclass, and maybe a "FunctionalGroup" subclass also. That seems like a good place to start, but maybe I'm misunderstanding OOP and this is bad. But then my problem really gets confusing (for me). Even though I have all these concepts/ideas/classes, I don't fully grasp what datastructures are needed to represent the molecule. A list of atoms would be a good thing to have. Could that list be a list of Atom objects? I would also need to have a way to store connectivity. A 2D matrix seems like a good idea, with bond order as integers in the matrix positions.

At this point I'm starting to get overwhelmed with the task. Is everything I'm doing so far make sense? Attaching a display/drawing aspect on top of this may mean that I need to rewrite/rework a lot of these things, but I'm just trying to get to a point where I can at least store molecules with the relevant data and then access that data to check/modify. I was thinking of doing this in Python, so the code/classes would perhaps look something like this: <http://pastebin.com/uUi1BMzr>

Perhaps this is really a programming questions for StackOverflow, but I thought it was specific enough to go here. Any assistance would be greatly appreciated, even if you just point out where I have made conceptual blunders. Thanks in advance.