I kept it similar to the way it is handled in the other two functions. I left the cmd variable because it is used farther down in the function.