public int reverseBits(int n) {

		int ret = 0;
		for(int i = 0; i< 32; i++){
			ret += 1 & n; // only calculate on the lowest bit
			n >>>= 1;
			if(i<31){
				ret <<= 1;
			}
			
		}
		return ret;
		
	}