Added option to use extent from specified file, and some PEP8 work