Area filling algorithm