public int reverse(int x) {
		  int result = 0;
		  boolean flag = x < 0 ? true : false;
		  x = flag ? -x : x;
		  
		  while(x != 0){
			  result = result*10 + x % 10;
			  x /=10;
		  }
	      return flag ? -result : result;
	 }