Adding indices to the format strings to make this code Python 2.6 compatible.