compelted P_Queue, made test cases