Added some more proper comments and java docs