Multiple changes

- Refactored the implementation of the print function.
- Added a new example.