homework 3

final... working correctly