code reformatting for easier reading; fixed 2 minor static analyzer warnings