win loss logic finally working........finally