refactored; made separate text class to handle representation of text and drawing