added rect functions