added working code for gpio