Wrote 2D and 3D rectangle methods.