change chr.split to chr.split('') in toNum() helper [thanks phil]