Seems to work fine, now also with command line input of filenames