Moved Windows STDIN to function body