Updated template code with my solution to Assignment 2