Comments and refactoring for the entire code
TODO: add menu
TODO: create GUI interface class