Assignment requirements met. Needs some polishing though