added some comments and modifecations. NOTE: The reset button doesn't hold. I toggle again to the original situation. It needs to be fixed.