Added rectangle generator function