Final code for the command prompt