Added "c" and "i" options to formatting function
Finished formatting and output function