Adding Encoder test code