Added outputs, and fixed up heap addition, but not removal. Queue addition added as well.