Added code for Command and Query