Changed datatype representation of Rect and added func. spec. to validRectangle.