Restructuring

Added comments and split classes into separate files.