added gpio monitor and improved encoder performance