code reformatting, truncation fixes, moar comments