Repository: pbiswas101/Mathball (js)

Issue:
Kaprekar Number
### Do the checklist before filing the issue:

- [ ] Is this something you can **debug and fix**?
- [x] Do you have Node.js and all the relevant dev-dependencies installed?
- [ ] Is this a **feature request** that you can add?

###### NOTE: Provide a clear and concise description of the feature that needs to be added! Or if its a bug, then provide the necessary steps to reproduce it.

- *Give your answer below:*

------------

[Function: **M.isKaprekar()**] needs to be added!
For more info:

https://www.geeksforgeeks.org/kaprekar-number/

*M.isKaprekar()* needs to accept a positive integer and all other arguments passed should throw a type error which needs to be handled gracefully! For error handling, you should refer to how other features like M.isArmstrong() is implemented.

Pull request description:
Reorganize Number Modules (#135)
Fixed bugs in hoax and rangePrime methods

Added respective test cases in range-spec, find-spec and check-spec

### Do the checklist before submitting the PR:

- [:heavy_check_mark:] Have you read the guidelines mentioned in **CONTRIBUTING.md**?
- [:heavy_check_mark:] Have you squashed your commits?

**Q**: What version of *Node.js* you've used in the project? (`e.g. Node v10.11.0`)
**A**:v11.10.1

**Q**: Mention the *Issue Number*! (`e.g. Fixed #8`)
**A**:#135

- *Give additional information regarding the PR below:*

------------


Patch:
diff --git a/README.md b/README.md
index f825df1..0c09a3f 100644
--- a/README.md
+++ b/README.md
@@ -22,11 +22,11 @@ $ npm install mathball --save
 
 ## Features
 
-- **Number Checkers** - [isArmstrong][3] - [isAutomorphic][4] - [isCarmichael][43] - [isDeficient][42] - [isFrugal][47] - [isHarshad][45] - [isKaprekar][23] - [isLucky][24] - [isNeon][5] - [isPalindrome][6] - [isPerfect][27] - [M.check('prime')(Number)][7] - [isSmith][26] - [isStormer][52] -[isHoax][54]
+- **Number Checkers** - [isArmstrong][3] - [isAutomorphic][4] - [isCarmichael][43] - [isDeficient][42] - [isFrugal][47] - [isHarshad][45] - [isKaprekar][23] - [isLucky][24] - [isNeon][5] - [isPalindrome][6] - [isPerfect][27] - [M.check('numberCheckers')(Number)][7] - [isSmith][26] - [isStormer][52] -[isHoax][54]
 
-- **Find nth Number** - [bell][32] - [catalan][22] - [fibonacci][8] - [find][21] - [magic][9] - [nCr][48] - [magic][9] - [padovan][41] - [smart][25] - [triangular][93] - [ugly][56]
+- **Find nth Number** - [bell][32] - [catalan][22] - [fibonacci][8] - [find('nthNumber')(Number)][21] - [magic][9] - [nCr][48] - [magic][9] - [padovan][41] - [smart][25] - [triangular][93] - [ugly][56] 
 
-- **Range of Numbers** - [rangePrime][7] - [range][66] - [rangePalindrome][6]
+- **Range of Numbers** - [rangePrime][7] - [range('range_of_numbers')][66] - [rangePalindrome][6]
 
 - **Mathematical Utilities** - [Complex][49] - [frequency][40] - [gcd][10] - [getAllPerm][55] - [isEven][11] - [isOdd][12] - [lcm][13] - [length][14] - [max][15] - [median][64] - [min][16] - [modInv][39] - [nCr][48] - [pow][46] - [sort][17] - [sum][18] - [toDegrees][50] - [toRadians][51] - [matrixMultiply][58] - [matrixExpo][59] - [matrixChain][60] - [count][61] - [avg][62] - [findPrimeFactors][63] - [phi][67] - [addition][112] - [subtraction][113] - [multiplication][114] - [division][115] - [absolute][116] - [popcount][117]
 
@@ -138,4 +138,4 @@ The MIT License 2019 - [Priyabrata Biswas][20].
 [114]: https://github.com/pbiswas101/Mathball/blob/master/src/multiplication/index.js
 [115]: https://github.com/pbiswas101/Mathball/blob/master/src/division/index.js
 [116]: https://github.com/pbiswas101/Mathball/blob/master/src/absolute/index.js
-[117]: https://github.com/pbiswas101/Mathball/blob/master/src/popcount/index.js
\ No newline at end of file
+[117]: https://github.com/pbiswas101/Mathball/blob/master/src/popcount/index.js
diff --git a/src/armstrong/index.js b/src/armstrong/index.js
index 3399623..5b7f2fa 100644
--- a/src/armstrong/index.js
+++ b/src/armstrong/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.isArmstrong = num => {
+exports.check = num => {
 	validate(num, 'isArmstrong');
 	let str = num.toString();
 	return num == str.split('').reduce((prev, next) => prev + Math.pow(parseInt(next, 10), str.length), 0);
diff --git a/src/automorphic/index.js b/src/automorphic/index.js
index 16d5364..84fd840 100644
--- a/src/automorphic/index.js
+++ b/src/automorphic/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.isAutomorphic = num => {
+exports.check = num => {
 	validate(num, 'isAutomorphic');
 	let str = Math.pow(num, 2).toString();
 	return num == str.slice(str.indexOf(num.toString()));
diff --git a/src/bell/index.js b/src/bell/index.js
index ca0cd31..c2a2f0c 100644
--- a/src/bell/index.js
+++ b/src/bell/index.js
@@ -27,7 +27,7 @@ function bell(number){
 
 }
 
-exports.bell = num => {
+exports.find = num => {
 
     validate(num, 'bell');
 
diff --git a/src/carmichael/index.js b/src/carmichael/index.js
index e2c9490..4b67caf 100644
--- a/src/carmichael/index.js
+++ b/src/carmichael/index.js
@@ -26,7 +26,7 @@ function isCarmichael(n){
 	}
 	return false;
 }
-exports.isCarmichael = n => {
+exports.check = n => {
 	validate(n, 'isCarmichael');
 	return isCarmichael(n);
 };
diff --git a/src/catalan/index.js b/src/catalan/index.js
index 3d104f9..a6ebb55 100644
--- a/src/catalan/index.js
+++ b/src/catalan/index.js
@@ -13,7 +13,7 @@ function binomialCoeff(n, k) {
 	return res;
 }
 
-exports.catalan = num => {
+exports.find = num => {
 	validate(num, 'catalan');
 	let c = binomialCoeff(2 * num, num);
 	return c / (num + 1);
diff --git a/src/check/index.js b/src/check/index.js
index 6f4eb42..5e7aa50 100644
--- a/src/check/index.js
+++ b/src/check/index.js
@@ -1,3 +1,3 @@
 module.exports = arg => {
   return require(`../${arg}`).check;
-};
\ No newline at end of file
+};
diff --git a/src/isDeficient/index.js b/src/deficient/index.js
similarity index 96%
rename from src/isDeficient/index.js
rename to src/deficient/index.js
index 63ac8b1..98e3078 100644
--- a/src/isDeficient/index.js
+++ b/src/deficient/index.js
@@ -27,7 +27,7 @@ const addAllDivisors = arr => {
 	return arr.reduce(add);
 };
 
-module.exports = num => {
+exports.check = num => {
 	validate(num, 'deficient');
 	let divisors = findDivisors(num);
 	let sum = addAllDivisors(divisors);
diff --git a/src/fibonacci/index.js b/src/fibonacci/index.js
index 5f948c9..7e4eeb1 100644
--- a/src/fibonacci/index.js
+++ b/src/fibonacci/index.js
@@ -17,7 +17,7 @@ function fib(num) {
 	return total;
 }
 
-exports.fibonacci = num => {
+exports.find = num => {
 	validate(num, 'fibonacci');
 	return fib(num);
 };
@@ -41,4 +41,4 @@ const rangeFib = num => {
 exports.range = num => {
 	validate(num, 'rangeFibonacci');
 	return rangeFib(num);
-};
\ No newline at end of file
+};
diff --git a/src/isFrugal/index.js b/src/frugal/index.js
similarity index 97%
rename from src/isFrugal/index.js
rename to src/frugal/index.js
index 90f8e55..f5ea6b7 100644
--- a/src/isFrugal/index.js
+++ b/src/frugal/index.js
@@ -37,7 +37,7 @@ function genPrimeList(inp){
     return list;
 }
 
-exports.isFrugal = inp => {
+exports.check = inp => {
     validate(inp, 'isFrugal');
     
     let primeFactorisation = genPrimeList(inp);
@@ -54,4 +54,4 @@ exports.isFrugal = inp => {
     }
     
     return ((inpLength - factorsLength) > 0)? true: false;
-};
\ No newline at end of file
+};
diff --git a/src/harshad/index.js b/src/harshad/index.js
index 9619279..7d7b9ef 100644
--- a/src/harshad/index.js
+++ b/src/harshad/index.js
@@ -11,7 +11,7 @@ function isHarshad(num){
 	}
 	return num%sum === 0;
 }
-exports.isHarshad = num => {
+exports.check = num => {
 	validate(num, 'isHarshad');
 	return isHarshad(num);
 };
diff --git a/src/isHoax/index.js b/src/hoax/index.js
similarity index 73%
rename from src/isHoax/index.js
rename to src/hoax/index.js
index dc34ce7..cb07179 100644
--- a/src/isHoax/index.js
+++ b/src/hoax/index.js
@@ -1,5 +1,5 @@
 const validate = require('../validation/positive-integer');
-
+const check = require('../check');
 /**
  * hoax Number
  */
@@ -37,6 +37,11 @@ const findPrimeFactors = (num) => {
  * check if the number is a hoax
  */
 const isHoaxNumber = (num) => {
+
+if(check('prime')(num) === true){
+	return false;
+}
+else{
   num = num.toString();
   const primeFactor = findPrimeFactors(num);
   const sumofNum = num
@@ -44,12 +49,22 @@ const isHoaxNumber = (num) => {
     .map(val => Number(val))
     .reduce((a, b) => a + b);
 
-  const sumOfPrimeFactor = primeFactor.reduce((a, b) => a + b);
+let sumOfPrimeFactor = 0;
+for(let i = 0; i < primeFactor.length; i++){
+	let sum = 0;
+	let pf = primeFactor[i];
+	while(pf > 0){
+		sum +=  pf % 10;
+		pf = parseInt((pf / 10),10);
+	}
+	sumOfPrimeFactor += sum;
+}
 
   return sumofNum === sumOfPrimeFactor;
+}
 };
 
-exports.isHoax = (num) => {
+exports.check = (num) => {
   validate(num);
   return isHoaxNumber(num);
 };
diff --git a/src/index.js b/src/index.js
index 6093cc2..b025158 100644
--- a/src/index.js
+++ b/src/index.js
@@ -9,11 +9,11 @@ const armstrong = require('./armstrong'),
 	perfect = require('./perfect'),
 	prime = require('./prime'),
 	smith = require('./smith'),
-	isDeficient = require('./isDeficient'),
-	isFrugal = require('./isFrugal'),
-	isStormer = require('./isStormer'),
+	deficient = require('./deficient'),
+	frugal = require('./frugal'),
+	stormer = require('./stormer'),
 	carmichael = require('./carmichael'),
-	{ isHoax } = require('./isHoax'),
+	hoax = require('./hoax'),
 	check = require('./check');
 
 /* Find nth Number */
@@ -87,13 +87,13 @@ module.exports = {
 	mul: mul.mul,
 	div: div.div,
 	abs: abs.abs,
-	isHarshad: harshad.isHarshad,
+	harshad: harshad.isHarshad,
 	isEven,
 	isOdd,
-	isKaprekar: kaprekar.isKaprekar,
+	kaprekar: kaprekar.isKaprekar,
 	lcm,
 	length,
-	isLucky: lucky.isLucky,
+	lucky: lucky.isLucky,
 	magic: magic.magic,
 	matrixMultiply,
 	matrixChain: matrixChain.matrixChain,
@@ -102,20 +102,20 @@ module.exports = {
 	median,
 	min,
 	nCr,
-	isNeon: neon.isNeon,
-	isPalindrome: palindrome.isPalindrome,
+	neon: neon.isNeon,
+	palindrome: palindrome.isPalindrome,
 	rangePalindrome:palindrome.rangePalindrome,
-	isPerfect: perfect.isPerfect,
-	isFrugal: isFrugal.isFrugal,
+	perfect: perfect.isPerfect,
+	frugal: frugal.isFrugal,
 	performance,
 	pipe,
 	popcount,
 	pow,
 	phi: totient.phi,
-	isStormer: isStormer.isStormer,
+	stormer: stormer.isStormer,
 	rangePrime: prime.rangePrime,
 	smart: smart.smart,
-	isSmith: smith.isSmith,
+	smith: smith.isSmith,
 	sort,
 	sum,
 	avg,
@@ -124,14 +124,14 @@ module.exports = {
 	modInv: modInv.modInv,
 	frequency,
 	count,
-	isDeficient,
+	deficient: deficient.isDeficient,
 	PriorityQueue,
 	Stack,
 	Graph,
 	isCarmichael: carmichael.isCarmichael,
 	range,
 	Complex,
-	isHoax,
+	hoax: hoax.isHoax,
 	ugly,
 	triangular: triangular.triangular,
 	check
diff --git a/src/kaprekar/index.js b/src/kaprekar/index.js
index e751f12..75eee75 100644
--- a/src/kaprekar/index.js
+++ b/src/kaprekar/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.isKaprekar = num => {
+exports.check = num => {
 	validate(num, 'isKaprekar');
 	if (num == 1) {
 		return true;
diff --git a/src/lucky/index.js b/src/lucky/index.js
index 44d8452..b22c373 100644
--- a/src/lucky/index.js
+++ b/src/lucky/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.isLucky = num => {
+exports.check = num => {
 	validate(num, 'isLucky');
 	var counter = 2;
 	while (true) {
diff --git a/src/magic/index.js b/src/magic/index.js
index db9796b..c86157b 100644
--- a/src/magic/index.js
+++ b/src/magic/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.magic = num => {
+exports.find = num => {
 	validate(num, 'magic');
 	let pow = 1, res = 0;
 	while (num) {
diff --git a/src/neon/index.js b/src/neon/index.js
index 00c7f84..5a635b2 100644
--- a/src/neon/index.js
+++ b/src/neon/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.isNeon = num => {
+exports.check = num => {
 	validate(num, 'isNeon');
 	return num == Math.pow(num, 2).toString().split('')
 		.reduce((prev, next) => prev + parseInt(next, 10), 0);
diff --git a/src/padovan/index.js b/src/padovan/index.js
index 3147530..aecb36a 100644
--- a/src/padovan/index.js
+++ b/src/padovan/index.js
@@ -18,7 +18,7 @@ function pad(num) {
 	return pNext;
 }
 
-exports.padovan = num => {
+exports.find = num => {
 	validate(num, "padovan");
 	return pad(num);
 };
diff --git a/src/palindrome/index.js b/src/palindrome/index.js
index b62c841..afeb93f 100644
--- a/src/palindrome/index.js
+++ b/src/palindrome/index.js
@@ -5,12 +5,12 @@
 
 const validate = require('../validation/non-negative-integer');
 
-exports.isPalindrome = num => {
+exports.check = num => {
 	validate(num, 'isPalindrome');
 	return num == num.toString().split('').reverse().join('');
 };
 
-exports.rangePalindrome = (start, end) => {
+exports.range = (start, end) => {
 	validate(start, 'rangePal');
 	validate(end, 'rangePal');
 	
diff --git a/src/perfect/index.js b/src/perfect/index.js
index 1a7b0e6..6b9e75f 100644
--- a/src/perfect/index.js
+++ b/src/perfect/index.js
@@ -4,7 +4,7 @@
 
 const validate = require('../validation/positive-integer');
 
-exports.isPerfect = num => {
+exports.check = num => {
     validate(num, 'isPerfect');
     var count  = 0;
     for(var i=1; i<num; i++)
diff --git a/src/prime/index.js b/src/prime/index.js
index 176fd64..833393d 100644
--- a/src/prime/index.js
+++ b/src/prime/index.js
@@ -24,7 +24,7 @@ exports.check = num => {
  * Function: rangePrime()
  */
 
-exports.rangePrime = (n) => {
+exports.range = (n) => {
 	validate(n, 'rangePrime');
 	let numbers = Array(n + 1).fill(true);
 	numbers[0] = numbers[1] = false;
@@ -32,7 +32,7 @@ exports.rangePrime = (n) => {
 	for (let i = 0; i < numbers.length; i++) {
 		if (numbers[i]) {
 			primeNumbers.push(i);
-			for (let j = i; j < n; j += i) {
+			for (let j = i; j <= n; j += i) {
 				numbers[j] = false;
 			}
 		}
diff --git a/src/smart/index.js b/src/smart/index.js
index b252df1..f01455c 100644
--- a/src/smart/index.js
+++ b/src/smart/index.js
@@ -5,7 +5,7 @@
 const sort = require("../sort");
 const validate = require('../validation/positive-integer');
 
-exports.smart = num => {
+exports.find = num => {
 	validate(num, 'smart');
 	const size = 3000;
 	var primes = new Array(size);
diff --git a/src/smith/index.js b/src/smith/index.js
index 1757c06..dbfd919 100644
--- a/src/smith/index.js
+++ b/src/smith/index.js
@@ -59,7 +59,7 @@ function smith(num) {
 	return pDigitSum === sumDigits;
 }
 
-exports.isSmith = num => {
+exports.check = num => {
 	validate(num, 'isSmith');
 	sieveSundaram();
 	return smith(num);
diff --git a/src/isStormer/index.js b/src/stormer/index.js
similarity index 96%
rename from src/isStormer/index.js
rename to src/stormer/index.js
index 878e17a..1612a74 100644
--- a/src/isStormer/index.js
+++ b/src/stormer/index.js
@@ -27,10 +27,10 @@ function maxPrimeFactor(inp){
     return maxPrime;
 }
 
-exports.isStormer = n => {
+exports.check = n => {
 
     validate(n, 'isStormer');
     let largPFactor = maxPrimeFactor((n*n+1));
     
     return (largPFactor >= 2*n)?true:false;
-};
\ No newline at end of file
+};
diff --git a/src/triangular/index.js b/src/triangular/index.js
index 79943e9..2cf3896 100644
--- a/src/triangular/index.js
+++ b/src/triangular/index.js
@@ -6,16 +6,13 @@ const validate = require('../validation/positive-integer');
 
 const triangular = (n) => {
 	let sum = 0;
-	for(let i = 1; sum <= n; i++){
-		sum += i;
-		if(sum === n){
-			return true;}
-			
+	for(let i = 0; i < n; i++){
+		sum += (n - i);
 	}
-	return false;
+	return sum;
 };
 
-exports.triangular = (n) => {
+exports.find = (n) => {
 	validate(n, 'triangular');
 	return triangular(n);
 };
diff --git a/src/ugly/index.js b/src/ugly/index.js
index cc2f136..78d496a 100644
--- a/src/ugly/index.js
+++ b/src/ugly/index.js
@@ -34,7 +34,7 @@ const getNthUglyNumber = (n) => {
   return i;
 };
 
-exports.ugly = (n) => {
+exports.find = (n) => {
   validate(n, 'ugly');
 
   return getNthUglyNumber(n);


Test patch:
diff --git a/test/armstrong-spec.js b/test/armstrong-spec.js
index 6691607..34daa77 100644
--- a/test/armstrong-spec.js
+++ b/test/armstrong-spec.js
@@ -1,5 +1,5 @@
 const assert = require('assert'),
-	isArmstrong = require('../src/armstrong').isArmstrong;
+	isArmstrong = require('../src/armstrong').check;
 
 describe('[Function: isArmstrong]', () => {
 
diff --git a/test/automorphic-spec.js b/test/automorphic-spec.js
index 01e6812..d020e5c 100644
--- a/test/automorphic-spec.js
+++ b/test/automorphic-spec.js
@@ -1,5 +1,5 @@
 const assert = require('assert'),
-	isAutomorphic = require('../src/automorphic').isAutomorphic;
+	isAutomorphic = require('../src/automorphic').check;
 
 describe('[Function: isAutomorphic]', () => {
 
diff --git a/test/bell-spec.js b/test/bell-spec.js
index f9ee319..7113da4 100644
--- a/test/bell-spec.js
+++ b/test/bell-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-    bell = require("../src/bell").bell;
+    bell = require("../src/bell").find;
     
 describe("[Function: bell]", () => {
     it("should be a function", () => {
@@ -49,4 +49,4 @@ describe("[Function: bell]", () => {
     it("should return '52' when '5' is passed", () => {
 		assert.strictEqual(bell(5), 52);
     });
-});
\ No newline at end of file
+});
diff --git a/test/carmichael-spec.js b/test/carmichael-spec.js
index 6f23592..9644e1b 100644
--- a/test/carmichael-spec.js
+++ b/test/carmichael-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-	isCarmichael = require("../src/carmichael").isCarmichael;
+	isCarmichael = require("../src/carmichael").check;
 
 describe("[Function: isCarmichael]", () => {
 	it('should be a function', () => {
diff --git a/test/catalan-spec.js b/test/catalan-spec.js
index 7e9754a..43832cf 100644
--- a/test/catalan-spec.js
+++ b/test/catalan-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-	catalan = require("../src/catalan").catalan;
+	catalan = require("../src/catalan").find;
 
 describe("[Function: catalan]", () => {
 	it("should be a function", () => {
diff --git a/test/check-spec.js b/test/check-spec.js
index 04b6b62..f8f100d 100644
--- a/test/check-spec.js
+++ b/test/check-spec.js
@@ -6,6 +6,62 @@ describe("[Function: check]", () => {
 		assert.strictEqual(typeof check, "function");
   });
 
+	it('should return `true` when `armstrong` is called with 153', () => {
+		assert.strictEqual(check('armstrong')(153), true);
+});
+
+	it('should return true when automorphic is called with 76', () => {
+		assert.strictEqual(check('automorphic')(76), true);
+});
+
+	it('should return true when harshad is called with 3', () => {
+		assert.strictEqual(check('harshad')(3), true);
+	});
+
+	it('should return true when stormer is called with 4', () => {
+		assert.strictEqual(check('stormer')(4), true);
+	});
+
+	it('should return true when carmichael is called with 561', () => {
+		assert.strictEqual(check('carmichael')(561), true);
+	});
+
+	it('should return true when deficient is called with 21', () => {
+		assert.strictEqual(check('deficient')(21), true);
+	});
+
+	it('should return true when frugal is called with 125', () => {
+		assert.strictEqual(check('frugal')(125), true);
+	});
+
+	it('should retrun true when kaprekar is called with 45', () => {
+		assert.strictEqual(check('kaprekar')(45), true);
+	});
+
+	it('should return true when lucky is called with 3', () => {
+		assert.strictEqual(check('lucky')(3), true);
+	});
+
+	it('should return true when neon is called with 9', () => {
+		assert.strictEqual(check('neon')(9), true);
+	});
+
+	it('should return true when perfect is called with 6', () => {
+		assert.strictEqual(check('perfect')(6), true);
+	});
+
+	it('should return true when smith is called with 4', () => {
+		assert.strictEqual(check('smith')(4), true);
+	});
+
+	it('should return true when hoax is called with 22', () => {
+		assert.strictEqual(check('hoax')(22), true);
+	});
+
+	it('should return true when palindrome is called with 121', () => {
+		assert.strictEqual(check('palindrome')(121), true);
+	});
+
 	it("should return `true` when called `prime` with 2 as an argument", () => {
 		assert.strictEqual(check('prime')(2), true);
   });
diff --git a/test/fibonacci-spec.js b/test/fibonacci-spec.js
index 0fc873f..918c4e8 100644
--- a/test/fibonacci-spec.js
+++ b/test/fibonacci-spec.js
@@ -1,5 +1,5 @@
 const assert = require('assert'),
-	fibonacci = require('../src/fibonacci').fibonacci,
+	fibonacci = require('../src/fibonacci').find,
 	rangeFibonacci = require('../src/fibonacci').range;
 
 describe('[Function: fibonacci]', () => {
@@ -52,4 +52,4 @@ describe('[Function: rangeFibonacci]', () => {
 	it('should return `[0, 1, 1, 2]` when 2 is passed', () => {
 		assert.deepEqual(rangeFibonacci(2), [0, 1, 1, 2]);
 	});
-});
\ No newline at end of file
+});
diff --git a/test/find-spec.js b/test/find-spec.js
index 36efa16..b28437b 100644
--- a/test/find-spec.js
+++ b/test/find-spec.js
@@ -17,7 +17,39 @@ describe('[Function: find]', () => {
 	it('should return 1 when factorial is passed as arg & 1 is passed as arg for factorial', () => {
 		assert.strictEqual(find('factorial')(1), 1);
     });
-    
+
+	it('should return 52 when bell is called with 5', () => {
+		assert.strictEqual(find('bell')(5), 52);
+	});
+
+	it('should return 14 when catalan is called with 4', () => {
+		assert.strictEqual(find('catalan')(4), 14);
+	});
+
+	it('should return 5 when fibonacci is called with 5', () => {
+		assert.strictEqual(find('fibonacci')(5), 5);
+	});
+
+	it('should return 25 when magic is called with 2', () => {
+		assert.strictEqual(find('magic')(2), 25);
+	});
+
+	it('should return 12 when padovan is called with 21', () => {
+		assert.strictEqual(find('padovan')(12), 21);
+	});
+
+	it('should return 30 when smart is called with 1', () => {
+		assert.strictEqual(find('smart')(1), 30);
+	});
+
+	it('should return 8 when triangular is called with 36', () => {
+		assert.strictEqual(find('triangular')(8), 36);
+	});
+
+	it('should return 8 when catalan is called with 7', () => {
+		assert.strictEqual(find('ugly')(7), 8);
+	});
+
     it('should throw an error when an integer is passed as arg', () => {
 		assert.throws(() => find(7)(12), TypeError);
     });
diff --git a/test/harshad-spec.js b/test/harshad-spec.js
index f275feb..594222e 100644
--- a/test/harshad-spec.js
+++ b/test/harshad-spec.js
@@ -1,5 +1,5 @@
 const assert = require('assert'),
-	isHarshad = require('../src/harshad').isHarshad;
+	isHarshad = require('../src/harshad').check;
 
 describe('[Function: isHarshad]', () => {
 
diff --git a/test/isDeficient-spec.js b/test/isDeficient-spec.js
index 4fec1f5..0ed3b01 100644
--- a/test/isDeficient-spec.js
+++ b/test/isDeficient-spec.js
@@ -1,41 +1,41 @@
-const assert = require('assert');
-const isDeficient = require('../src/isDeficient');
+const assert = require('assert'),
+	deficient = require('../src/deficient').check;
 
-describe('[Function: isDeficient]', () => {
+describe('[Function: deficient]', () => {
 
 	it('should be a function', () => {
-		assert.strictEqual(typeof isDeficient, 'function');
+		assert.strictEqual(typeof deficient, 'function');
 	});
 
 	it('should throw TypeError when a negative number is passed as argument', () => {
-		assert.throws(() => isDeficient(-10), TypeError);
+		assert.throws(() => deficient(-10), TypeError);
 	});
 
 	it('should throw TypeError when a string is passed as argument', () => {
-		assert.throws(() => isDeficient('hello world'), TypeError);
+		assert.throws(() => deficient('hello world'), TypeError);
 	});
 
 	it('should throw TypeError when an array is passed as argument', () => {
-		assert.throws(() => isDeficient(['foo', 'bar', 1, 3]), TypeError);
+		assert.throws(() => deficient(['foo', 'bar', 1, 3]), TypeError);
 	});
 
 	it('should throw TypeError when an object is passed as argument', () => {
-		assert.throws(() => isDeficient({ foo: 'bar' }), TypeError);
+		assert.throws(() => deficient({ foo: 'bar' }), TypeError);
 	});
 
 	it('should throw TypeError when a function is passed as argument', () => {
-		assert.throws(() => isDeficient(isDeficient), TypeError);
+		assert.throws(() => deficient(deficient), TypeError);
   });
 
 	it('should return true when 10 is passed as an argument', () => {
-		assert.strictEqual(isDeficient(10), true);
+		assert.strictEqual(deficient(10), true);
 	});
 
 	it('should return false when 6 is passed as an argument', () => {
-		assert.strictEqual(isDeficient(6), false);
+		assert.strictEqual(deficient(6), false);
 	});
 
 	it('should return true when 1 is passed as an argument', () => {
-		assert.strictEqual(isDeficient(1), true);     // as always, 1 is a special case
+		assert.strictEqual(deficient(1), true);     // as always, 1 is a special case
 	});
 });
diff --git a/test/isFrugal-spec.js b/test/isFrugal-spec.js
index b8dc814..045ba66 100644
--- a/test/isFrugal-spec.js
+++ b/test/isFrugal-spec.js
@@ -1,45 +1,45 @@
 const assert = require('assert'),
-        isFrugal = require('../src/isFrugal').isFrugal;
+        frugal = require('../src/frugal').check;
 
-describe('[Function: isFrugal]', () => {
+describe('[Function: frugal]', () => {
 
     it('should be a function', () => {
-        assert.strictEqual(typeof isFrugal, 'function');
+        assert.strictEqual(typeof frugal, 'function');
     });
 
     it('should return a boolean value when a positive integer is passed', () => {
-        assert.strictEqual(typeof isFrugal(2), 'boolean');
+        assert.strictEqual(typeof frugal(2), 'boolean');
     });
 
     it('should throw an error when a negative number is passed', () => {
-		assert.throws(() => isFrugal(-20), TypeError);
+		assert.throws(() => frugal(-20), TypeError);
     });
     
     it('should throw an error when a floating point number is passed', () => {
-		assert.throws(() => isFrugal(20.51513), TypeError);
+		assert.throws(() => frugal(20.51513), TypeError);
     });
     
     it('should throw an error when a string is passed', () => {
-		assert.throws(() => isFrugal('20'), TypeError);
+		assert.throws(() => frugal('20'), TypeError);
     });
     
     it('should throw an error when no argument is passed', () => {
-		assert.throws(() => isFrugal(), TypeError);
+		assert.throws(() => frugal(), TypeError);
     });
     
     it('should return \'true\' when \'256\' is passed ', () => {
-        assert.strictEqual(isFrugal(256), true);
+        assert.strictEqual(frugal(256), true);
     });
 
     it('should return \'true\' when \'343\' is passed ', () => {
-        assert.strictEqual(isFrugal(343), true);
+        assert.strictEqual(frugal(343), true);
     });
 
     it('should return \'false\' when \'100\' is passed ', () => {
-        assert.strictEqual(isFrugal(100), false);
+        assert.strictEqual(frugal(100), false);
     });
 
     it('should return \'false\' when \'129\' is passed ', () => {
-        assert.strictEqual(isFrugal(129), false);
+        assert.strictEqual(frugal(129), false);
     });
-});        
\ No newline at end of file
+});
diff --git a/test/isHoax-spec.js b/test/isHoax-spec.js
index b57379b..6efafae 100644
--- a/test/isHoax-spec.js
+++ b/test/isHoax-spec.js
@@ -1,32 +1,32 @@
-const assert = require('assert');
-const { isHoax } = require('../src/isHoax');
+const assert = require('assert'),
+	hoax = require('../src/hoax').check;
 
-describe('[Function: isHoax]', () => {
+describe('[Function: hoax]', () => {
   it('should be a function', () => {
-    assert.strictEqual(typeof isHoax, 'function');
+    assert.strictEqual(typeof hoax, 'function');
   });
 
   it('should throw TypeError when an string is passed as an argument', () => {
-    assert.throws(() => isHoax('string'), TypeError);
+    assert.throws(() => hoax('string'), TypeError);
   });
 
   it('should return `true` when 84 is passed as an argument', () => {
-    assert.strictEqual(isHoax(84), true);
+    assert.strictEqual(hoax(84), true);
   });
 
   it('should return `false` when 15 is passed as an argument', () => {
-    assert.strictEqual(isHoax(15), false);
+    assert.strictEqual(hoax(15), false);
   });
 
   it('should return `false` when 3 is passed as an argument', () => {
-    assert.strictEqual(isHoax(3), false);
+    assert.strictEqual(hoax(3), false);
   });
 
   it('should return `false` when 16 is passed as an argument', () => {
-    assert.strictEqual(isHoax(16), false);
+    assert.strictEqual(hoax(16), false);
   });
 
   it('should return `false` when 19 is passed as an argument', () => {
-    assert.strictEqual(isHoax(19), false);
+    assert.strictEqual(hoax(19), false);
   });
 });
diff --git a/test/kaprekar-spec.js b/test/kaprekar-spec.js
index 8589f8b..113f646 100644
--- a/test/kaprekar-spec.js
+++ b/test/kaprekar-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-	isKaprekar = require("../src/kaprekar").isKaprekar;
+	isKaprekar = require("../src/kaprekar").check;
 
 describe("[Function: isKaprekar]", () => {
 	it("should be a function", () => {
diff --git a/test/lucky-spec.js b/test/lucky-spec.js
index 1bba6a6..d3bb574 100644
--- a/test/lucky-spec.js
+++ b/test/lucky-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-	isLucky = require("../src/lucky").isLucky;
+	isLucky = require("../src/lucky").check;
 
 describe("[Function: isLucky]", () => {
 	it("should be a function", () => {
diff --git a/test/magic-spec.js b/test/magic-spec.js
index 4f068a6..5c2bd95 100644
--- a/test/magic-spec.js
+++ b/test/magic-spec.js
@@ -1,5 +1,5 @@
 const assert = require('assert'),
-	magic = require('../src/magic').magic;
+	magic = require('../src/magic').find;
 
 describe('[Function: magic]', () => {
 
diff --git a/test/neon-spec.js b/test/neon-spec.js
index b1647b2..76ccaa1 100644
--- a/test/neon-spec.js
+++ b/test/neon-spec.js
@@ -1,38 +1,38 @@
 const assert = require('assert'),
-	isNeon = require('../src/neon').isNeon;
+	neon = require('../src/neon').check;
 
-describe('[Function: isNeon]', () => {
+describe('[Function: neon]', () => {
 
 	it('should be a function', () => {
-		assert.strictEqual(typeof isNeon, 'function');
+		assert.strictEqual(typeof neon, 'function');
 	});
 
 	it('should return a boolean value when a positive integer is passed', () => {
-		assert.strictEqual(typeof isNeon(1), 'boolean');
+		assert.strictEqual(typeof neon(1), 'boolean');
 	});
 
 	it('should return \'true\' when \'9\' is passed', () => {
-		assert.strictEqual(isNeon(9), true);
+		assert.strictEqual(neon(9), true);
 	});
 
 	it('should return \'false\' when \'7\' is passed', () => {
-		assert.strictEqual(isNeon(7), false);
+		assert.strictEqual(neon(7), false);
 	});
 
 	it('should throw an error when a negative number is passed', () => {
-		assert.throws(() => isNeon(-20), TypeError);
+		assert.throws(() => neon(-20), TypeError);
 	});
 
 	it('should throw an error when a floating point is passed', () => {
-		assert.throws(() => isNeon(31.101996), TypeError);
+		assert.throws(() => neon(31.101996), TypeError);
 	});
 
 	it('should throw an error when a string is passed', () => {
-		assert.throws(() => isNeon('31'), TypeError);
+		assert.throws(() => neon('31'), TypeError);
 	});
 
 	it('should throw an error when no arguments passed', () => {
-		assert.throws(() => isNeon(), TypeError);
+		assert.throws(() => neon(), TypeError);
 	});
 
 });
diff --git a/test/padovan-spec.js b/test/padovan-spec.js
index cb314ad..a6df88f 100644
--- a/test/padovan-spec.js
+++ b/test/padovan-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-	padovan = require("../src/padovan").padovan;
+	padovan = require("../src/padovan").find;
 
 describe("[Function: padovan]", () => {
 	it("should be a function", () => {
diff --git a/test/palindrome-spec.js b/test/palindrome-spec.js
index d2eeb95..6684ee9 100644
--- a/test/palindrome-spec.js
+++ b/test/palindrome-spec.js
@@ -1,39 +1,39 @@
 const assert = require('assert'),
-	isPalindrome = require('../src/palindrome').isPalindrome,
-	rangePalindrome = require('../src/palindrome').rangePalindrome;
+	palindrome = require('../src/palindrome').check,
+	rangePalindrome = require('../src/palindrome').range;
 
-describe('[Function: isPalindrome]', () => {
+describe('[Function: palindrome]', () => {
 
 	it('should be a function', () => {
-		assert.strictEqual(typeof isPalindrome, 'function');
+		assert.strictEqual(typeof palindrome, 'function');
 	});
 
 	it('should return a boolean value when a non-negative integer is passed', () => {
-		assert.strictEqual(typeof isPalindrome(1), 'boolean');
+		assert.strictEqual(typeof palindrome(1), 'boolean');
 	});
 
 	it('should return \'true\' when \'141\' is passed', () => {
-		assert.strictEqual(isPalindrome(141), true);
+		assert.strictEqual(palindrome(141), true);
 	});
 
 	it('should return \'false\' when \'726\' is passed', () => {
-		assert.strictEqual(isPalindrome(726), false);
+		assert.strictEqual(palindrome(726), false);
 	});
 
 	it('should throw an error when a negative number is passed', () => {
-		assert.throws(() => isPalindrome(-20), TypeError);
+		assert.throws(() => palindrome(-20), TypeError);
 	});
 
 	it('should throw an error when a floating point is passed', () => {
-		assert.throws(() => isPalindrome(31.101996), TypeError);
+		assert.throws(() => palindrome(31.101996), TypeError);
 	});
 
 	it('should throw an error when a string is passed', () => {
-		assert.throws(() => isPalindrome('31'), TypeError);
+		assert.throws(() => palindrome('31'), TypeError);
 	});
 
 	it('should throw an error when no arguments passed', () => {
-		assert.throws(() => isPalindrome(), TypeError);
+		assert.throws(() => palindrome(), TypeError);
 	});
 
 });
@@ -80,4 +80,4 @@ describe('[Function: rangePalindrome]', () => {
 		assert.deepEqual(rangePalindrome(0,18), [0,1,2,3,4,5,6,7,8,9,11]);
 	});
 
-});
\ No newline at end of file
+});
diff --git a/test/perfect-spec.js b/test/perfect-spec.js
index c7eea15..2766491 100644
--- a/test/perfect-spec.js
+++ b/test/perfect-spec.js
@@ -1,38 +1,38 @@
 const assert = require('assert'),
-    isPerfect = require('../src/perfect').isPerfect;
+    perfect = require('../src/perfect').check;
 
-describe('[Function: isPerfect]', () => {
+describe('[Function: perfect]', () => {
 
 	it('should be a function', () => {
-		assert.strictEqual(typeof isPerfect, 'function');
+		assert.strictEqual(typeof perfect, 'function');
 	});
 
 	it('should return a boolean value when a positive integer is passed', () => {
-		assert.strictEqual(typeof isPerfect(1), 'boolean');
+		assert.strictEqual(typeof perfect(1), 'boolean');
 	});
 
 	it('should return \'true\' when \'496\' is passed', () => {
-		assert.strictEqual(isPerfect(496), true);
+		assert.strictEqual(perfect(496), true);
 	});
 
 	it('should return \'false\' when \'34\' is passed', () => {
-		assert.strictEqual(isPerfect(34), false);
+		assert.strictEqual(perfect(34), false);
 	});
 
 	it('should throw an error when a negative number is passed', () => {
-		assert.throws(() => isPerfect(-20), TypeError);
+		assert.throws(() => perfect(-20), TypeError);
 	});
 
 	it('should throw an error when a floating point is passed', () => {
-		assert.throws(() => isPerfect(31.101996), TypeError);
+		assert.throws(() => perfect(31.101996), TypeError);
 	});
 
 	it('should throw an error when a string is passed', () => {
-		assert.throws(() => isPerfect('31'), TypeError);
+		assert.throws(() => perfect('31'), TypeError);
 	});
 
 	it('should throw an error when no arguments passed', () => {
-		assert.throws(() => isPerfect(), TypeError);
+		assert.throws(() => perfect(), TypeError);
 	});
 
 });
diff --git a/test/prime-spec.js b/test/prime-spec.js
index dfb44d5..372c932 100644
--- a/test/prime-spec.js
+++ b/test/prime-spec.js
@@ -1,7 +1,7 @@
 const assert = require('assert'),
 	prime = require('../src/prime'),
 	isPrime = prime.check,
-	rangePrime = prime.rangePrime;
+	rangePrime = prime.range;
 
 describe('[Function: isPrime]', () => {
 
@@ -124,4 +124,4 @@ describe('[Function: rangePrime]', () => {
 		assert.deepStrictEqual(rangePrime(1), []);
 	});
 
-});
\ No newline at end of file
+});
diff --git a/test/range-spec.js b/test/range-spec.js
index fc6be83..6af53b3 100644
--- a/test/range-spec.js
+++ b/test/range-spec.js
@@ -1,5 +1,7 @@
 const assert = require('assert'),
-	range = require('../src/range');
+	range = require('../src/range'),
+	rangePrime = range('prime'),
+	rangePalindrome = range('palindrome');
 
 
 describe('[Function: range]', () => {
@@ -15,22 +17,28 @@ describe('[Function: range]', () => {
 	it('should return `[0, 1, 1, 2]` when fibonacci is passed as arg & 2 is passed as arg to fibonacci', () => {
 		assert.deepEqual(range('fibonacci')(2), [0, 1, 1, 2]);
     });
-    
-    it('should throw an error when no arguments passed', () => {
-        assert.throws(() => range(), TypeError);
-    });
 
-    it('should throw an error when a number is passed', () => {
-        assert.throws(() => range(31), TypeError);
-    });
+	it('should return [2, 3, 5, 7, 11, 13, 17, 19] when 20 is passed to rangePrime', () => {
+		assert.deepStrictEqual(rangePrime(20), [2, 3, 5, 7, 11, 13, 17, 19]);
+	});
 
-    it('should throw an error when a negative number is passed', () => {
-        assert.throws(() => range(-20), TypeError);
-    });
+	it('should return [55,66,77,88,99] when 50, 100 is passed to rangePalindrome', () => {
+		assert.deepStrictEqual(rangePalindrome(50,100), [55,66,77,88,99]);
+	});
 
-    it('should throw an error when a floating point is passed', () => {
-        assert.throws(() => range(31.101996), TypeError);
-    });
+	it('should throw an error when no arguments passed', () => {
+		assert.throws(() => range(), TypeError);
+	});
 
+	it('should throw an error when a number is passed', () => {
+		assert.throws(() => range(31), TypeError);
+	});
 
-});
\ No newline at end of file
+	it('should throw an error when a negative number is passed', () => {
+		assert.throws(() => range(-20), TypeError);
+	});
+
+	it('should throw an error when a floating point is passed', () => {
+		assert.throws(() => range(31.101996), TypeError);
+	});
+});
diff --git a/test/smart-spec.js b/test/smart-spec.js
index bceab9f..0a64e72 100644
--- a/test/smart-spec.js
+++ b/test/smart-spec.js
@@ -1,5 +1,5 @@
 const assert = require("assert"),
-	smart = require("../src/smart").smart;
+	smart = require("../src/smart").find;
 
 describe("[Function: smart]", () => {
 	it("should be a function", () => {
diff --git a/test/smith-spec.js b/test/smith-spec.js
index 2617092..871341e 100644
--- a/test/smith-spec.js
+++ b/test/smith-spec.js
@@ -1,36 +1,36 @@
 const assert = require("assert"),
-	isSmith = require("../src/smith").isSmith;
+	smith = require("../src/smith").check;
 
-describe("[Function: isSmith]", () => {
+describe("[Function: smith]", () => {
 	it("should be a function", () => {
-		assert.strictEqual(typeof isSmith, "function");
+		assert.strictEqual(typeof smith, "function");
 	});
 
 	it("should return a boolean value when a positive integer is passed", () => {
-		assert.strictEqual(typeof isSmith(1), "boolean");
+		assert.strictEqual(typeof smith(1), "boolean");
 	});
 
 	it("should return 'true' when '483' is passed", () => {
-		assert.strictEqual(isSmith(483), true);
+		assert.strictEqual(smith(483), true);
 	});
 
 	it("should return 'false' when '34' is passed", () => {
-		assert.strictEqual(isSmith(34), false);
+		assert.strictEqual(smith(34), false);
 	});
 
 	it("should throw an error when a negative number is passed", () => {
-		assert.throws(() => isSmith(-20), TypeError);
+		assert.throws(() => smith(-20), TypeError);
 	});
 
 	it("should throw an error when a floating point is passed", () => {
-		assert.throws(() => isSmith(31.101996), TypeError);
+		assert.throws(() => smith(31.101996), TypeError);
 	});
 
 	it("should throw an error when a string is passed", () => {
-		assert.throws(() => isSmith("31"), TypeError);
+		assert.throws(() => smith("31"), TypeError);
 	});
 
 	it("should throw an error when no arguments passed", () => {
-		assert.throws(() => isSmith(), TypeError);
+		assert.throws(() => smith(), TypeError);
 	});
 });
diff --git a/test/stormer-spec.js b/test/stormer-spec.js
index 2cb2f3d..ca98c3b 100644
--- a/test/stormer-spec.js
+++ b/test/stormer-spec.js
@@ -1,45 +1,45 @@
 const assert = require('assert'),
-        isStormer = require('../src/isStormer').isStormer;
+        stormer = require('../src/stormer').check;
 
-describe('[Function: isStormer', () => {
+describe('[Function: stormer', () => {
 
     it("should be a function", () => {
-		assert.strictEqual(typeof isStormer, "function");
+		assert.strictEqual(typeof stormer, "function");
     });
 
     it("should throw an error when a string is passed", () => {
-		assert.throws(() => isStormer("31"), TypeError);
+		assert.throws(() => stormer("31"), TypeError);
     });
 
     it("should throw an error when a boolean is passed", () => {
-		assert.throws(() => isStormer(true), TypeError);
+		assert.throws(() => stormer(true), TypeError);
     });
 
     it("should throw an error when a non-negative number is passed", () => {
-		assert.throws(() => isStormer(-31), TypeError);
+		assert.throws(() => stormer(-31), TypeError);
     });
 
     it("should throw an error when no arguments passed", () => {
-		assert.throws(() => isStormer(), TypeError);
+		assert.throws(() => stormer(), TypeError);
     });
     
     it("should return a boolean", () => {
-		assert.strictEqual(typeof isStormer(5), "boolean");
+		assert.strictEqual(typeof stormer(5), "boolean");
     });
 
     it("should return 'true' when '11' is passed", () => {
-        assert.strictEqual(isStormer(11), true);
+        assert.strictEqual(stormer(11), true);
       });
 
     it("should return 'true' when '1' is passed", () => {
-    assert.strictEqual(isStormer(1), true);
+    assert.strictEqual(stormer(1), true);
     });
 
     it("should return 'true' when '6' is passed", () => {
-        assert.strictEqual(isStormer(6), true);
+        assert.strictEqual(stormer(6), true);
     });
 
     it("should return 'false' when '7' is passed", () => {
-    assert.strictEqual(isStormer(7), false);
+    assert.strictEqual(stormer(7), false);
     });
-});      
\ No newline at end of file
+});
diff --git a/test/triangular-spec.js b/test/triangular-spec.js
index 83f22e0..21ed72d 100644
--- a/test/triangular-spec.js
+++ b/test/triangular-spec.js
@@ -1,17 +1,13 @@
 const assert = require('assert'),
-triangular = require('../src/triangular').triangular;
+triangular = require('../src/triangular').find;
 
 describe('[Function: triangular]', () => {
 	it('should be a function', () => {
 		assert.strictEqual(typeof triangular, 'function');
 	});
 
-	it('should return true when 55 is passed', () => {
-		assert.strictEqual(triangular(55), true);
-	});
-
-	it('should return false when 40 is passed', () => {
-		assert.strictEqual(triangular(40), false);
+	it('should return 36 when 8 is passed', () => {
+		assert.strictEqual(triangular(8), 36);
 	});
 
 	it('should throw an error when a boolean is passed', () => {
diff --git a/test/ugly-spec.js b/test/ugly-spec.js
index adce390..9258e67 100644
--- a/test/ugly-spec.js
+++ b/test/ugly-spec.js
@@ -1,5 +1,5 @@
 const assert = require('assert');
-const { ugly } = require('../src/ugly');
+const  ugly  = require('../src/ugly').find;
 
 describe('[Function: ugly]', () => {
   it('should be a function', () => {