Major change to encoder