worked on the drawTitle function