redid bits that got lost, moved some debug to flash