added extents calculation