changed the variables around to make the conditionals work