Explaining bug fix and slight re-working