added functional & imperitive versions of 33