Implemented pressing of switch.