Added in the extent calclation function.  Fix to ctx push/pop whatnot?