modification on quad_encoder_block