Updated code for new hardware