class rectangle, code sample grid rectangle