End of explaination for getting the extent