Fixed the merge function and implemented findPrio and deletePrio.