Working Priority Algorithm

Should work fully now, but transfering processes was not tested.