filled in missing code to complete assignment