First version that works

organize classes into the right way, now has proper polymorphism. This
is the first version that works. Bugs to be fixed later.