refactored guess method