logic modified