Added javadoc. Formatted code. Removed unused activity/imports/comments.