reads input from sample.txt