Adding my solution to Prog Assig 2