Some resources to understand the algorithm:
https://docs.google.com/presentation/d/1huuSKHTAl5zq7zBl14f8tkkKhPFOaX6lfmrVHDigk-s/edit?usp=sharing
https://docs.google.com/document/d/1WkSDyTAnQ9PU7aAXwmYSvkPl5jZCtsTRwwNtozGP8UE/edit?usp=sharing
https://medium.com/angular-in-depth/angular-smart-404-page-85a45b109fd8