Adds print and encode functionality.