a small collection of algorithms