add documentation for commands in res function