a simple bwt implemented