Added Bi phase encoder