improved logic in guess check