Finally added select and deselect events and deficit calc.