Implement an arbitrary turn function
Use a fold instead of recursion