My solution to Prog Assign 2 - use this one