 							}
 							
 						}
-						else if (snake.x<b*4) {
+						else if (snake.x<xTurn+b*3) {
 							if(i==1) {
 								snakeBods[i].x = snake.x-b*(i+1);
 								snakeBods[i].y = yTurn;

						}
						
					}
					if (dir == "l") { //trying this out
						
						if (snake.x>stage.width-b*3) {
							if(i==0) {
								snakeBods[i].x = snake.x+b;
								snakeBods[i].y = yTurn;

			}
			
		}
		public function reverse(d:String, snake:Snake): void {
			bounce = true;
			if(d == "right"){
				vx *= -1;
				vy=0;
				snake.y-=50;
				snake.x+=50;
				xTurn = snake.x;
				yTurn = snake.y;
				
				snake.rotation = 0;
				dir="r";
			}
			if (d == "left") {
				vx *= -1;
				vy=0;
				snake.y+=50;
				snake.x-=50;
				xTurn = snake.x;
				yTurn = snake.y;
				
				snake.rotation = 180;
				dir="l";
			}
			if (d == "up") {
				vy *= -1;
				vx=0;
				snake.x-=50;
				snake.y-=50;
				xTurn = snake.x;
				yTurn = snake.y;
				
				snake.rotation = -90;
				dir="u";
			}
			if (d == "down") {
				vy *= -1;
				vx=0;
				snake.x+=50;
				snake.y+=50;
				xTurn = snake.x;
				yTurn = snake.y;
				
				snake.rotation = 90;
				dir="d";
			}
			
		}
		//all this needs to be fixed again to go along with being added to the stage instead of the snake.
		//now I am cutting out the use of this method to turn the snake bodies a different way.
		/*old turn snake
		public function turnSnake(dir:String, snake:Sprite):void {  //input the direction of the turn with the keyboard event; "up" "down" "left" or "right" (right could actually be any other string.)
			
			//var bods:Array = body;
