working with logic