wrong logic, now fixed