Implemented balanced brackets in Python. Closes issue #30