nesting of if statements for checking value of smooth