Added a format function

Haven't tested the new function, added Testing boolean.