accept input file as command line param
simplify the api a bit