include an index when collapsing if statements
call functions with the correct argument count
support nested if statements