Condensed functions and added appropriate comments. Still having issues with java files