Working on longest prefix match