fixed the definition of fold (the order in which the arguments where passed was wrong)