added support for accepting input from a file path instead of stdin