adding source ripped from Text Mode plugin