Added file extensions to encode