This is assignment 3 in SPL.