partway through switching to token stream parsing