closures example 1
Added special function for takeWhile example