Scanning now works again. It no longer is hardcoded to values specific to one encoder. Also, some changes to make it more understandable (a variable named "degrees" contained encoder tics? Wat?).