reworked js, take in prompt