improved testing code, now can verify answers offline