cleanup in files, added some javadoc and removed unused lines