Added test and valid check for Rectangle