Added some test cases, and update on the type checking method