added  conditional statements