Corrected print function