implemented history command to print out the history