Reworked for in class assignment