code reformatted