Final code for command prompt