Extent function modified to take PHI and Theta also into consideration for calculation of Bounding Box.