My player character rotates in place. Help much appreciated!

Ok, so im very new to Csharp. But i thought it’d be cool to learn how to make diablolike click to move movement scripts. Well im stuck. everything works as intended except the character spins in place when standing still. Help me unity forum. you’re my only hope. what am i doing wrong?

using UnityEngine;
using System.Collections;

public class Movement_PC : MonoBehaviour
{
    public float speed;
    private Vector3 position;
    public CharacterController cc;
	
	void Start ()
    {
	
	}


    void Update()
    {
        if (Input.GetMouseButton(0))
        {

            locatePostion();
        }

        moveToPosition();
    }

    void locatePostion()
        {
        RaycastHit hit;
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if(Physics.Raycast(ray, out hit, 1000))
        {
            position = new Vector3(hit.point.x, hit.point.y + 1f, hit.point.z);
            Debug.Log(position);

        }

        }
    void moveToPosition()
    {
        if (Vector3.Distance(transform.position, position) > 1);
        {
            Quaternion newRotation = Quaternion.LookRotation(position - transform.position);

            newRotation.x = 0f;
            newRotation.z = 0f;

            transform.rotation = Quaternion.Slerp(transform.rotation, newRotation, Time.deltaTime * 10);
            cc.SimpleMove(transform.forward * speed);
        }
        
    }
}

I have almost the same script. I have actually been stuck on getting my character to use animations. So just an FYI, the animation part of that is not working.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ClickToMove : MonoBehaviour
{

public float speed;
private Vector3 position;
public CharacterController controller;

public Animation anim;

// Use this for initialization
void Start () 
{
	position = transform.position;
	
}

// Update is called once per frame
void Update () 
{
	if(Input.GetMouseButton(0))
	{
	//Locate Where the play clicked on the terrain
		locatePosition();
	}
	moveToPosition ();
}

void locatePosition()
{
	RaycastHit hit;
	Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);

	if (Physics.Raycast (ray, out hit, 1000)) 
	{
		position = new Vector3 (hit.point.x, hit.point.y, hit.point.z);
		Debug.Log (position);
	}
}
//Move the Player to the Position
void moveToPosition()
{

	//When player is moving
	if (Vector3.Distance (transform.position, position) > 2) 
	{
		Quaternion newRotation = Quaternion.LookRotation (position - transform.position, Vector3.forward);

		newRotation.x = 0f;
		newRotation.z = 0f;

		transform.rotation = Quaternion.Slerp (transform.rotation, newRotation, Time.deltaTime * 10);
		controller.SimpleMove (transform.forward * speed);

		anim = GetComponent<Animation> ();
		anim.CrossFade ("run");

	} 
		//Player is not moving
		else 
	{
		anim = GetComponent<Animation> ();
		anim.CrossFade ("idle");
	}
}

}

Remove the semicolon at the end of that line.

if (Vector3.Distance(transform.position, position) > 1)