Small refactoring, added comments, renamed main file