Changed it to automatically generate the priority