modified for assignment 2