Did some small changes and implemented a dispose method in shape.