added a feature and code for deleting commands (and tweak other features a bit)