changed readKey to stdin and not keyboard