Added higherOrder functions with tests