added merged code for final breadboard, please check