Updated the command main method