Implemented full type checking, but nothing is tested yet.