Added rectangle filling algorithm