Updated Encoder Test Code