add ability to sample from STDIN