Added testRectangle

Made some changes aswell to the classes