Fixed input from stdin and added greedy tour