Moving turning function to pointer-based approach