added working code & board diagram