working on #MSG-4: dupe checking
#MSG-10: added lookahead