refactored checkToken code so that it does not hard code phase number, now the phase is inited at the beginning of the file in a var called inheritedPhase