extracted bwtDecod and rleDecode1