implementing bucket fill

Currently bucket fill works only for very small areas...looking for a
more efficient way