rest of homework 3 - complete