player doesent dive when shift is pressed

ive been oding this script following a tutorial ive just finished the tutorial and im working on diving ive bound that to left shift but when its pressed leftshift does nothing heres the code

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

public class Swim : MonoBehaviour
{

public CharacterController cc;
public CharacterMotor cm;
float waterLvl = gameObject.name(Water);
bool onSurface = false;
bool ondryland = !isswimming && (Physics.colliderhit(TerrainCollider));
		
		
		void Start ()
		{
				RenderSettings.fog = false;
				RenderSettings.fogColor = new Color (0.1f, 0.8f, 0.8f, 0.2f);
				RenderSettings.fogDensity = 0.6f;
				cc = gameObject.GetComponent <CharacterController> ();
				cm = gameObject.GetComponent <CharacterMotor> ();



		
		void Update (){
		
			
			bool OnSurface (){
				
				onSurface = CheckIfOnSurface ()
			}
	
		
		if (Input.GetKeyDown (KeyCode.Space) && !onSurface);
			cm.SetVelocity (new Vector3 (cc.velocity.x, 3, cc.velocity.z));
	

		if (Input.GetKeyDown (KeyCode.LeftShift) && isswimming)
			cm.SetVelocity (new Vector3 (cc.velocity.x, -3, cc.velocity.z));
	}
			
		bool CheckIfOnSurface () {
			return transform.position.y >= waterLvl;
		
		}
		
		bool isswimming() {
		
		return onsuface;
		}
		
	(!onSurface()
		{
		
			cm.movement.maxForwardSpeed = 2;
			cm.movement.maxSidewaysSpeed = 2;
			cm.movement.maxBackwardsSpeed = 2;
			cm.movement.maxFallSpeed = 2;
		
		}
	
	
	 (isswimming()){
	
			cm.movement.maxForwardSpeed = 4;
			cm.movement.maxSidewaysSpeed = 4;
			cm.movement.maxBackwardsSpeed = 4;
			cm.movement.maxFallSpeed = 0;
		
		}
	 else 
	 {
			(ondryland()){
	
			cm.movement.maxForwardSpeed = 6;
			cm.movement.maxSidewaysSpeed = 6;
			cm.movement.maxBackwardsSpeed = 6;
			cm.movement.maxFallSpeed = 20;
		}
	}
}

yes this is the same code from my previous question

how would i make the player dive correctly?

p.s the player can now swim and dive under water but i wanted to check if the player was in the waer at all and im getting error including a parsing error that should not be there

thanks in advanced

float waterLvl = 60;
bool onSurface = false;

	void Update () {
		onSurface = CheckIfOnSurface();

		if (Input.GetKeyDown (KeyCode.LeftShift))
			cm.SetVelocity (new Vector3 (cc.velocity.x, -3, cc.velocity.z));

		if (Input.GetKeyDown (KeyCode.Space) && !onSurface)
			cm.SetVelocity (new Vector3 (cc.velocity.x, 3, cc.velocity.z));
	}

	bool CheckIfOnSurface(){
		return transform.position.y >= waterLvl;
	}

alt text
Me rewriting this code