fixes in Gomorry function