function works, gets correct answers
complete