Edited printTitle method