var Calci = {
 init: function(){
  $('#calculator .input').click (function(){
    if(this.dataset.keyType == "digit"){
      Calci.handleInput(this.dataset.digit);
    
    } else if(this.dataset.keyType == "operator") {
      Calci.handleInput(this.dataset.operator);
    
    }else if(this.dataset.keyType == "delete"){
     Calci.handleDelete ();
    }else if(this.dataset.keyType == "equals"){
      Calci.evaluateResult ();
     }
 });
    $("#calculator #delete").dblclick(function(){
      $("#preview").html("");
      $("#result").html("");
  });
    ['0','1','2','3','4','5','6','7','8','9'].forEach (function(digit){
      $(document).bind('keyup',digit, function(){
      Calci.handleInput(digit);
      });
    });
      $(document).bind('keyup','backspace', function(){
        Calci.handleDelete ();
    });
},

 handleInput: function(input) {
  $("#preview").html($("#preview").html()+ input);
},

 handleDelete: function  (){
  $("#preview").html($("#preview").html().slice(0, -1));
},
 evaluateResult: function (){
  $("#result").html(eval($("#preview").html()));
  }
};
  
  $(document).ready(function(){
  Calci.init();
});
@@ -494,58 +494,26 @@
     
-$(%22#preview%22).html(%22%22);%0A      $(%22#result%22).html(%22%22
+Calci.clearResult(
 );%0A 
@@ -561,16 +561,36 @@
 ,'8','9'
+,'/','*','+','-','.'
 %5D.forEac
@@ -804,16 +804,267 @@
     %7D);%0A
+      $(document).bind('keyup','shift+=', function()%7B%0A        Calci.handleInput ('+');%0A    %7D);%0A      %5B'=','return'%5D.forEach(function(key)%7B%0A          $(document).bind('keyup', key, function()%7B%0A            Calci.evaluateResult ();%0A        %7D);%0A      %7D);%0A
 %7D,%0A%0A han
@@ -1232,16 +1232,85 @@
 , -1));%0A
+  if($(%22#preview%22).html().length == 0)%7B%0A    Calci.clearResult();%0A  %7D%0A
 %7D,%0A eval
@@ -1383,16 +1383,75 @@
 ml()));%0A
+  %7D,%0A  clearResult: function()%7B%0A    $('#result').html('');%0A
   %7D%0A%7D;%0A 

handle all inputs