Added Javadocs and reformated everything