minor fixes
Added support for declarations inside if conditions: JavaScript doesn't allow them but Swift does.. moved the declarations outside if condition