tests fixed and comments added