replaced arg "int len" with strlen()