completed code for review