rest of homework 5 - complete