Solving with Gomorry algorithm moved to new function