finished higher order functions