Corrected mistake with extent calculation