Updated to work with GPIO on PI