Working and Debuged version of Priorities