First fully working version.

Added comments for classes and methods.