Trying to see if this version of format() function from the original
will do something about the crashes from free()...