Fixed supposedly revised logic