merging in (some of) Daniel's GPIO pin stuff