Added function for extracting files to lessen how many times I needed to rewrite code.