Fixed bugs, changed buffer from <> to <| |>, functions store statements & scope, flatten and scan scope