Added javadocs comments, fixed import warnings and spelling errors