initialize variables and add conditions