Added rectangularity function.