 		public function addBody(size:int):void {
 			
 			//Add the body segments
-			var p:int = 0;    //placeholder for putting on the snake bods
+			
 			for(var i:int = 0; i<size; i++){
 				bod = new SnakeBod();
-				p += b;
-				addObject(bod, snake.x-p, snake.y);				
+				
+				addObject(bod, path[i][0], path[i][1]);	//use path to place the bodies		
 				bod.rotation = 90;
 				snakeBods.push(bod);
 			}
-			p += b;
-			addObject(tail,snake.x-p, snake.y);
+			
+			addObject(tail,path[size][0], path[size][1]);
 			tail.rotation = 90;
 			snakeBods.push(tail);
 		}
-		
+		public function addPath(x:int, y:int, r:int):void {
+			var rot:int;
+			if (r == 0) {rot=0;}
+			else if (r == 90) {rot=1;}
+			else if (r == 180) {rot=2;}
+			else {rot=3;}
+			while(pCount < 10) {
+				path[0][pCount] = [x,y,rot];
+			}
+			if (pCount == 10) {
+				pCount = 0;
+				for(var i:int = 0; i < size; i++) {
+					path.pop();
+					path[i] = path[i+1];
+				}
+				
+				bodyCount += 1;
+				
+				if (bodyCount == size+1) {
+					bodyCount = 0;
+				}
+			}
+			if (r == 0) {rot=0;}
+			else if (r == 90) {rot=1;}
+			else if (r == 180) {rot=2;}
+			else {rot=3;}
+			
+			pCount += 1;
+		}
 		
 		
 		public function enterFrameHandler(event:Event):void {
 			//var p:int = 0;
 			snake.x += vx;
 			snake.y += vy;
-			
+			addPath(snake.x, snake.y, snake.rotation);
 			for(var i:int = 0; i<size+1; i++) {
 				snakeBods[i].x += vx;
 				snakeBods[i].y += vy;

		private var rocks:Array = new Array();
		public var symbol:SymRock;
		private var symRocks:Array = new Array();
		//public var boxMap:Object = new Object();  //hopefully dont need this
		public var size:int = 3; //length of the snake
		public var snakeBods:Array = new Array();
		public var bod:SnakeBod;

				}
			}
			
			addObject(snake, 200, 50); 
			path[0][0] = [snake.x, snake.y, 1];
			addBody(size);
			dir = 'r';
		}
