modified basename call to provide the extension after the filename as -s SUFFIX doesn't seem to be present outside of a mac