the print function works correctly now as well