public String compress(String toCompress){
		char[] charArray = toCompress.toCharArray();
		StringBuffer compressed = new StringBuffer();
		int count = 1 ;
		char previous = 0 ;
		for(int i = 0 ; i < charArray.length ; i++){
			
			if(previous == charArray[i]){
				count ++;
				if(charArray.length == i+1 ){
					compressed.append(previous+""+count);
				}
				continue;
			}else{
				if(previous != 0 && count != 1)
					compressed.append(previous+""+count);
				if(count == 1)
					compressed.append(previous+"");
				count = 1;
				previous = charArray[i];
			}
		}
		if(charArray.length == compressed.toString().toCharArray().length)
			return toCompress;
		else 
			return compressed.toString();
	}