fixed couple of bugs
integrated with gpio
fixed bugs