Code cleanup, documenting code
Adding states and comments
Documenting main state
Documenting all states