Help! I am creating Rotary Encoder Meter with Arduino

Hello Friends I am making a project on Arduino for my personal use it is a Rotary Encoder Length Meter I researched on internet in find this Code but little bug in this code kindly help me to make it perfect.
I want to measure length with this project: for this I am using KY-040 Rotary Encoder, OLED Display and Arduino Nano
I want to make it first OLED will show the Splash Screen Display for 10 Seconds after that it will count the position of Rotary Encoder in if I rotate Clock wise it should increase the value and if I rotate Counter Clock wise it should reduce the value and should display the value on OLED and also if I want to increase and reduce values in 0.001 or any other in decimal numbers and also Arduino should store/Update the last value in EEPROM and read the last value from EEPROM and if I press the center button it should reset the value to 0 also in EEPROM

the code that I found It is making bug when I rotate anti-clockwise it goes 65335 after 0 it should goo to -1, -2, -3

and also in this code when I rotate fast it does not work I want to make it run fast.

Link of my simulation which I create:

I need Help If any one can help me...

Use signed numbers as opposed to ints to record encoder position.

You must be using an ‘unsigned’ int (or uint16_t?) as a counter somewhere. Change it to ‘int’ (or int16_t)

find the code that uses interrupts if you want it to respond to change of position immediately

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