improving text file decoding