added a bit error checking
rename brackets
bug for empty []/{}; check extra left brackets