Cleaned up the code a bit more and documented more code and cleaned up other docs