optimised [used gsub instead of each_char]