move specs to lib folder, test sort of priority queue