Very simple FPS mouse look script error

I made my own mouselook script as simple as possible but i got some errors/bugs
**The script is attached to the camera **
I think i only need to set the max up and down angle to fix my problem but i dont know…
So my problem is that my camera starts rotating in every direction even i Z…
Exactly i dont even know why this happens or what my problem is so here is the script:
using UnityEngine;
using System.Collections;

public class Rotate : MonoBehaviour {
	public float rotSpeed;
	public float x;
	public float y;
	void Update () {
		x = Input.mousePosition.x;
		y = Input.mousePosition.y; 

		if (x > Screen.width / 2)
			transform.Rotate (new Vector3 (0, 1, 0) * rotSpeed * Time.deltaTime);
		if (x < Screen.width / 2)
			transform.Rotate (new Vector3 (0, -1, 0) * rotSpeed * Time.deltaTime);
		if (y > Screen.height / 2)
			transform.Rotate (new Vector3 (-1, 0, 0) * rotSpeed * Time.deltaTime);
		if (y < Screen.height / 2)
			transform.Rotate (new Vector3 (1, 0, 0) * rotSpeed * Time.deltaTime);
	}
}

You’re rotating around multiple axes. If I rotate 8 degrees y followed by 10 degrees x it’s going to rotate based on my rotation positions after the 8 degrees y. The way I generally handle this is have my parent rotate around x and then the camera rotate its local y. That way the y and x are independent rotations.

Assets/mouseLook.cs(1,23): error CS0246: The type or namespace name `MonoBehaviour’ could not be found. Are you missing a using directive or an assembly reference?