some minor adjustments, better comments