higher order functions for function composition, laziness, backtracking, and other magic