Added fixed version of Pelmanism from Kees