A few algorithms implemented in SML