implemented homework 2 requirements