Standard ML code developed for and inspired by smlpraxis.com