Added code for irrigation control