modified to encoding module