added algorithm for checking types and validating arguments for the cli