now uses pinControl functions