An extension of the Burrows-Wheeler Transform