filling algorithm finished. seems to be a bit inperformant.