change input to check for up and down state instead of up or down
transitions