Adding incrementing filename code that solves the previous problems. Minimally tested, so user beware.