public void avoid(PolarPoint obstacleLocation) {
		System.out.println("Avoiding...");

		keepAvoiding = true;

		int turnDirection = 0; //1 for left, -1 for right
		
		int scanAngle = 0;
		PolarPoint leftCorner = new PolarPoint(0,90);
		PolarPoint rightCorner = new PolarPoint(0,-90);
		int prevDist = 0;
		
		while ((leftCorner.angle >= 70) && (rightCorner.angle <= -70)) {
			mover.travel(-20);
		
		boolean isObjectAtAngle = scanner.scanAtAngle(scanAngle).dist < 50;
		while (scanAngle < 90 ) {
			scanAngle += 10;
			PolarPoint obstacle = scanner.scanAtAngle(scanAngle);
			isObjectAtAngle = obstacle.dist < 80;
			if (!isObjectAtAngle) {
				leftCorner = new PolarPoint(prevDist, scanAngle--);
				break;
			} else {
				prevDist = obstacle.dist;
			}
		}
		
		scanAngle = 0;
		isObjectAtAngle = scanner.scanAtAngle(scanAngle).dist < 50;
		while (scanAngle > -90 ) {
			scanAngle -= 10;
			PolarPoint obstacle = scanner.scanAtAngle(scanAngle);
			isObjectAtAngle = obstacle.dist < 80;
			if (!isObjectAtAngle) {
				rightCorner = new PolarPoint(prevDist, scanAngle--);
				break;
			} else if (scanAngle > leftCorner.angle) {
				rightCorner = new PolarPoint(0, leftCorner.angle + 10);
			} else {
				prevDist = obstacle.dist;
			}
		}
		
		}
		boolean isLeftObstacle = Math.abs(leftCorner.angle) > Math.abs(rightCorner.angle);
		boolean isRightObstacle = !isLeftObstacle;

		scanner.scanAtAngle(0);
		
		PolarPoint cornerToAvoid = new PolarPoint(0,0);

		if (isRightObstacle) {
			turnDirection = 1; //Right obstacle -> turn left.
			cornerToAvoid = leftCorner;
			
			Sound.playNote(Sound.PIANO, 200, 5);
			Sound.playNote(Sound.PIANO, 300, 5);
			Sound.playNote(Sound.PIANO, 400, 5);
			Sound.playNote(Sound.PIANO, 800, 5);
		} else {
			turnDirection = -1; //Left obstacle -> turn right.
			cornerToAvoid = rightCorner;
			
			Sound.playNote(Sound.PIANO, 800, 5);
			Sound.playNote(Sound.PIANO, 400, 5);
			Sound.playNote(Sound.PIANO, 300, 5);
			Sound.playNote(Sound.PIANO, 200, 5);
		}

		if (keepAvoiding) {
			mover.turn(turnDirection * 95, false);
			heading += turnDirection * 95;
			mover.travel((cornerToAvoid.dist * Math.abs(Math.sin(Math.toRadians(cornerToAvoid.angle)))) + 15, false);
		}
		
		scanner.scanAtAngle(0);
		mover.turn(-heading, false);
		heading = 0;

	}