adding tests for higher order functions