Changed 'stdin' to check for EOF
Updated documentation