updated comments and added JAVADOCs