I am completely lost... maybe a priority queue?