greatly simplified code for new hardware