Large changes to HW2 text formatter