filling algorithm done. might be inperformant.