added methods for drawing legend and title