updated char class constructor algorithm