Code wriiten while reading the book "Mining Massive Datasets"