First Version of Encoder