changed answer check algorithm