move trimming to actual read_stdin() function.