rect: fix bug in rect; add doc; rename method.