How to Build Algorithms