changing logic a bit