added some optimization; turned on the diods on the startup