updated gpio code