Rename variable plen to str_len to improve readability