New code for Regis since his version crashes on his phone.