Updated toString function