turn format() into a functor, add print function, move to namespace str
add print function