allow file objects as well as file names
add stdout argument
accept stdin as input
rough pr text