Added filling algorithm, not working perfectly ATM