working with first-order functions