Added geometry-guessing code based on the partition table