getCommands() function added.