Added more complicated functionality for homework due 03/12