Added Anaga's changes. Fixed user case 3 and 5. added comments