Changing vertical to else if