Finished higher order function exercises