wrote parse_command function (untested)