Made minor logical changes