updated with logic design