javadoced and added minor fixes