refactored file structure and names. Added Java doc.