Important fix to speed up the code. Important bug fix for inappropriate behavior of `heap`.

The newly computed `u` values were being pushed as a list into the
heap. Due to this, heap behaved as a stack instead of having the
smallest element on top.

The newly computed values are now pushed into the `heap` only if they
were INSIDE earlier. Earlier both BAND and INSIDE pixels were pushed.
This causes a duplication of BAND pixels in the heap with different `u`
values and hence causing the program to be slow.