Code refactoring, added better comments
Code refactoring, added better comments, removed unused methods