Added the ability to specify custom filenames. Fixes #2