Changed prompt() to getSelection() and changed output to be zero-indexed to match usage in the rest of the program.