fixed
added sorted insert to deque