SML homework for Coursera