pick the bin of A with highest value V
while V > value_threshold {
order the corresponding pointlist from PTLIST
merge in high gradient neighbors within 10
degrees
create line segment from final point list
zero out that bin of A
pick the bin of A with highest value V }