Algorithms to understand how it works