How to restrict an object's constantly changing position?

So I’m making a VERY simple enemy AI, where the AI simply follows the player. My only problem is that the object kind of floats upwards as it follows the player. I know that I need to use a clamp, but I’m not sure where in my script I need to place it and what has to be in it, so, if anyone can look at my script below and help me, I would appreciate the help!

using UnityEngine;
using System.Collections;

public class EnemyAI : MonoBehaviour {

	public Transform player;
	public float speed;
	

	// Update is called once per frame
	void Update () {
		float step = speed * Time.deltaTime;
		transform.position = Vector3.MoveTowards (transform.position, player.position, step);
	}
}

void Update () {
float step = speed * Time.deltaTime;
Vector3 newPos = Vector3.MoveTowards (transform.position, player.position, step);
newPos.y = Mathf.Clamp(newPos.y, min_y, max_y);
transform.position = newPos;
}