adds function to transition eleciton from one state to the next