Implemented iswellFormed.

TODO -check if correct on an other program.