changed some conditional statements