Algorithms rewritten