Solution for CMPS109 assignment 3 in W14