Updated with logic