First implementation of the specification checking

Probably there are bugs around