Added pin opening routine.  There seems to be an issue with permissions though.  I'll have to do more research to understand why permissions are denied when opening pins.