Algorithms implemented from scratch.