implemented last command