Help! I am creating Rotary Encoder Meter with Arduino

Thanks, It. works in -1, -2, and -3 on counter clock rotation. help me in rest of my problems.