some more basic stuff
some fixes and more bracket calculation