Added persistent hash-maps and sets to prevent computations on huge datasets form exhausting memory.