encode function is implemented for BurrowsWheeler.java