better for importing with standard naming
fix output writing to specific file
cleanup and stderr writing instead of stdout