added longest common prefix