added a lot of docs for the typesystem rules
enhanced type checking rules