More clean up of unused functions. Add Javadocs and comments