added file input as parameter and more options.