added initial cmdchain code