Added comments, restructuring