put prompt in its own function