working with win logic function