Added fast encoding