Changed blocked queue to priority queue, added priority queue functions

Also added setup for the blocked on waiting queue