Added support for 4 encoders