Changed priorityQueue to ArrayList, fixed a typo