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

		public var dir:String; //l,r,u,d for the direction the snake is going.
		public var turn:Boolean = false;
		public var bounce:Boolean = false;
		public function Mukik()
		{
			board = 

		public function addBody(size:int):void {
			
			//Add the body segments
			
			for(var i:int = 0; i<size; i++){
				bod = new SnakeBod();
				
				addObject(bod, path[i][0], path[i][1]);	//use path to place the bodies		
				bod.rotation = 90;
				snakeBods.push(bod);
			}
			
			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;
