Added implementation of getRects