both exercises
function object exercise 1