Some handy algorithms.