Updated to read from STDIN