diff --git a/calculator.js b/calculator.js
index 3e5744c..559f003 100644
--- a/calculator.js
+++ b/calculator.js
@@ -6,60 +6,72 @@
* @return {object} `calculator` object that can be used
*/
-
- /**
- * sets the `total` to the number passed in
- * @param { Number } x
- * @return { Number } current total
- */
-
-
- /**
- * Return the value of `total`
- * @return { Number }
- */
-
-
- /**
- * Sums the value passed in with `total`
- * @param { Number } x
- */
-
-
- /**
- * Subtracts the value passed in from `total`
- * @param { Number } x
- */
-
-
- /**
- * Multiplies the value by `total`
- * @param { Number } x
- */
-
-
- /**
- * Divides the value passing in by `total`
- * @param { Number } x
- */
-
-
- /**
- * Return the value stored at `memory`
- * @return { Number }
- */
-
-
- /**
- * Stores the value of `total` to `memory`
- */
-
-
- /**
- * Clear the value stored at `memory`
- */
-
- /**
- * Validation
- */
-
+function calculatorModule(){
+ let _memory = 0;
+ let _total = 0;
+
+ function load (num) {
+ validate (num);
+ _total = num;
+ return _total;
+ };
+
+ function getTotal () {
+ return _total;
+ };
+
+ function add (num) {
+ validate (num);
+ _total += num;
+ };
+
+ function subtract (num) {
+ validate (num);
+ _total -= num;
+ };
+
+ function multiply (num) {
+ validate (num);
+ _total *= num;
+ };
+
+ function divide (num) {
+ validate (num);
+ _total /= num;
+ };
+
+ function recallMemory () {
+ return _memory;
+ };
+
+ function saveMemory () {
+ _memory = _total;
+ };
+
+ function clearMemory () {
+ _memory = 0;
+ };
+
+ function validate (num) {
+ if (typeof num !== 'number') {
+ throw new Error('Try again!');
+ } else {
+ return true
+ }
+ };
+
+ let calculator = {
+ load: load,
+ getTotal: getTotal,
+ add: add,
+ subtract: subtract,
+ multiply: multiply,
+ divide: divide,
+ recallMemory: recallMemory,
+ saveMemory: saveMemory,
+ clearMemory: clearMemory
+ };
+
+return calculator;
+
+};
diff --git a/index.html b/index.html
index 639742b..8958b85 100644
--- a/index.html
+++ b/index.html
@@ -11,5 +11,7 @@
+
+