Made some improvements

Added the check for the end of the array in headUp which was recommended
by the teacher.

The check if the position should really be changed in the downHeap
function was not really neccessary. The loop alreay checks that! It will
only be called unnecessarily on the first round, however that doesn't do
any bad, as at this point, biggerPos is the same as pos.