Format and add comments and java docs