added the structure for isValid
implemented the test for LineString