make_command_stream pseudocode