implemented higher-order functions task
Merge pull request #4 from astrieanna/higher-order

implemented higher-order functions task