rearranged order so that prettyprint works