made logic better