Added a load of higher order functions stuff