high order functions solved