combined two conditionals into one