Workning code for party
Changed datastructure in party to deque