Added conditional statements