simplified code a little bit and removed some bugs
added namespaces rect and circle to twod, and functions for calculating whether a rect overlaps with another and the same for a circle