Implimented the prority concept in the command generation and management