added comments explaining command functions