improved convertstr.pl