move genMode to RT, put in all the pieces for calculateMismatch(not yet working)