higer order functions working