fixed #6, add minlimit and maxlimit rule, test cases.