Fixed a bug and added a print statement to the gpio output