fix bracket highlighting for open brackets (#20)
fix bracket highlighting for close brackets (closes #20)
use switch to simplify direction (#20)