HTPi: Rearranging and minor edits