arrange common function to toolbox
end inning1
fix prepare file to execute from command line