implemented Type.validate - need to test it