better logic than earlier