Changed logic for addition new elements

now 1st it checks if such a value has been already added. So it prevents having the same value with different keys.

In other words it's not quite a classic heap anymore.