a bit smarter bracket checking (not perfect, but ok); check for existing var/let statement