Moved print code out of engine