Added some java doc and did some clean up of dead code