Updated to work with new rect api.