added conditional statements