need help with logic homework