Index: src/com/example/helloandroid/Fleet.java
===================================================================
--- src/com/example/helloandroid/Fleet.java	(revision c27abf40d544cf18ba34f39f43fe995f3d4d1678)
+++ src/com/example/helloandroid/Fleet.java	(revision 9ef6f68d3d6a036b13e70b935ff93adf81574241)
@@ -1,3 +1,5 @@
 package com.example.helloandroid;
+
+import java.util.ArrayList;
 
 public class Fleet {
@@ -11,4 +13,5 @@
 	private int numShips;
 	private int faction;
+	private boolean isNextToAPlanet;
 	
 	/* Optimising: pre-calculate paths */
@@ -17,9 +20,9 @@
 		if((destination.getX() - source.getX()) != 0){
 		//line formula 
-		slope = ((source.getY() - destination.getY())/(source.getX() - destination.getX()));
+		slope = getSlope(source.getX(),source.getY(),destination.getX(),destination.getY());
 		xIntercept = destination.getY() - (slope*destination.getX());
 		
 		//direction
-		direction = 1/Math.tan(slope);
+		direction = Math.atan(slope);
 		
 		//coordinates for all 4 coordinates
@@ -48,4 +51,5 @@
 		this.faction = faction;
 		this.destination = destination;
+		this.isNextToAPlanet = false;
 	}
 	
@@ -123,6 +127,45 @@
 
 
-	public void update() {
+	public void update(ArrayList<Planet> planets) {
 		int speed = 1; //pixels per move
+		double distance, tangentDirection, angle;
+		Planet temp = null;
+		//is the ship going around a planet already
+		if(!isNextToAPlanet){
+			/*looks through all the planets to figure out if
+			the ship's path is about to intersect a planet*/
+			for(Planet p: planets){
+				//if two point of intersection are found save planet 
+				distance = getDistanceBetween(dblX,dblY,p.getX(),p.getY());
+				if(distance <= p.radius){
+					temp = p;
+					break;
+				}
+			}
+			//if temp planet is not picked move along the direction by #speed
+			if(temp == null){
+				dblY += (Math.sin(direction)*speed);
+				dblX += (Math.cos(direction)*speed);
+				
+				x = (int)dblX;
+				y = (int)dblY;
+			} else 
+			//otherwise
+			{
+				//figure out which way to go clockwise or counter clockwise 
+				tangentDirection = (Math.atan(getSlope(temp.getX(),temp.getY(),dblX,dblY))) + (Math.PI/2);
+				angle = Math.atan((Math.tan(tangentDirection) - Math.tan(direction))/(1 + Math.tan(tangentDirection)*Math.tan(direction)));
+				if (angle <= Math.PI/2)
+					angle = Math.PI - angle;
+				//get next point and the direction and set it
+			}
+		} else {
+			//can you reach the center of the planet by following this direction
+			//if so set isNextToAPlanet to false and move 
+			//otherwise continue moving along the circumferenceds4
+		
+		}
+		
+		
 	}
 	
@@ -137,3 +180,14 @@
 		}
 	}
+	
+	//helper functions
+	private double getDistanceBetween(double x1, double y1, double x2, double y2)
+	{
+		return Math.sqrt(Math.pow((x2 - x1),2) + Math.pow((y2 - y1),2));
+	}
+	
+	private double getSlope(double x1, double y1, double x2, double y2)
+	{
+		return ((y1 - y1)/(x2 - x1));
+	}
 }
