Collapsible if statements
removed unused variables