Added ability to test with input from stdin