implemented rectangle geometry function which is modular and can be upgraded