Bug Fixing of format order

Needed to change the order of the format by index order rather than the
order they where created.