A few algorithms.