completed tests and solution for bracket matcher