Finished priorities and fixed some bugs