Adding code for assignment 2