updated code for project3