overridden print and swap for char