fixed shuffling, added ability to read from stdin