Removed unused code, added JavaDoc