added methods for determining error margin when buttons are pressed