creating a generic conditional statement