Started adapting code to new encGetPos.