Finished implementing the PRINT function core