Updated to use RPIO