cleaned up stdin behavior and command line args