Cleaned up code/Javadoc

I added javadocs and deleted unused portions of code.