ex. 1-13 in scm, hs and js