if (Meteor.isClient) {
  var inc = 1.0;
  var ppl = {
    'student': {
      'rate': 1.15,
      'price': 100,
      'numberOwned': 0
    },
    'intern': {
      'rate': 1.25,
      'price': 150,
      'numberOwned': 0
    },
    'programmer': {
      'rate': 1.35,
      'price': 200,
      'numberOwned': 0
    }
  };
  Session.setDefault('rate', 1.0);
  Session.setDefault('score', 0);
  Session.setDefault('time', 0);

  var interval = Meteor.setInterval(function () {
    return null;
  }, 1000);

  Template.cookie.helpers({
    score: function () {
      return Session.get('score');
    }
  });

  Template.cookie.events({
    'click button': function () {
      Session.set('score', Session.get('score') + (inc * Session.get('rate')));
    }
  });

  Template.buy.events({
    'click button': function (event) {
      var person = ppl[event.target.id];
      if (Session.get('score') >= person.price) {
        Session.set('score', Session.get('score') - person.price);
        Session.set('rate', Session.get('rate') * person.rate);
        person.numberOwned += 1;
      }
    }
  })
}

if (Meteor.isServer) {
  Meteor.startup(function () {
  });
}

@@ -16,16 +16,32 @@
 ient) %7B%0A
+  var interval;%0A
   var in
@@ -49,16 +49,16 @@
  = 1.0;%0A
-
   var pp
@@ -98,12 +98,9 @@
 e': 
-1.15
+2
 ,%0A  
@@ -112,19 +112,19 @@
 price': 
-100
+256
 ,%0A      
@@ -181,12 +181,9 @@
 e': 
-1.25
+3
 ,%0A  
@@ -199,11 +199,11 @@
 e': 
-150
+512
 ,%0A  
@@ -268,12 +268,9 @@
 e': 
-1.35
+4
 ,%0A  
@@ -286,11 +286,12 @@
 e': 
-200
+1024
 ,%0A  
@@ -428,79 +428,43 @@
 0);%0A
-%0A
   
-var interval = Meteor.setInterval(function () %7B%0A    return null;%0A  %7D
+Session.setDefault('timeInterval'
 , 10
@@ -589,32 +589,32 @@
 cookie.events(%7B%0A
-
     'click butto
@@ -627,24 +627,245 @@
 nction () %7B%0A
+      if (interval === undefined) %7B%0A        interval = Meteor.setInterval(function () %7B%0A          Session.set('score', Session.get('score') + (inc * Session.get('rate')));%0A        %7D, Session.get('timeInterval'));%0A      %7D%0A
       Sessio

Increment score on time interval