Changes to correct logic