added the cmd3 code