header added

plus a few clean-ups here and there