Add 1-5 and update function of obtaining user input to type-safe