performance fix

the fill loop is huge time consuming, need optimization.