Fixed some errors
Added edge selection for encoders