Added logic with balancing the glyphs and refactored the existing methods