Rewrite HOFs
Use evals instead of multiple applys in HOFs and recursion code