Updated as per Assignment 2 instructions