Denoting KNOWN as 0 and BAND by 1
Removed the HeapElem class
Added generate_flags to __all__
flag and u with 2 more rows and columns than the mask, for avoiding IndexError at the boundary