Add comments, javadocs, refactor code

-Add comments and javadocs to all classes tha require them
-Refactor code to be more understandable and simple