Added function to run commands.