HW2 in SML