Update formatting and added some comments. Should have no functional change.