{
  "information": {
    "Title": "ejss_model_dotandcrossdiagram8 Covalent Bonding 'Dot and Cross' Simulation",
    "Author": [
      "Written by Loo Kang Wee",
      "Felix J. Garcia Clemente",
      "Francisco Esquembre",
      "Designed by David Loh"
    ],
    "AuthorLogo": [
      "./01authorlookang50x50.png",
      "./01authorFelix_J_Garcia_Clemente.png",
      "./01authorPacoEsquembre2011.png",
      "./01authordavidloh50x50.png"
    ],
    "Password": "",
    "Keywords": "Chemical Bonding  Dot and Cross Diagrams",
    "Abstract": "",
    "Copyright": "CC-BY-SA-NC",
    "Level": "Seondary 3 and 4",
    "Language": "English",
    "Logo": [
      "./polyatomicions/Screenshot 2019-12-27 at 4.52.25 PM (2).png"
    ],
    "RunAlways": "true",
    "ModelTab": "",
    "ModelTabTitle": "",
    "ModelName": "",
    "FixedNavigationBar": "false",
    "CSSFile": "",
    "DetectedFiles": [
      "./01authorFelix_J_Garcia_Clemente.png",
      "./01authorPacoEsquembre2011.png",
      "./01authordavidloh50x50.png",
      "./01authorlookang50x50.png",
      "./polyatomicions/Screenshot 2019-12-27 at 4.52.25 PM (2).png"
    ],
    "AuxiliaryFiles": [
      "./polyatomicions/"
    ],
    "HTMLHead": "<script async=\"true\" src=\"https://www.googletagmanager.com/gtag/js?id=UA-3326007-19\"></script>\n<script>\n  window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n  gtag('config', 'UA-3326007-19');\n</script>\n<script data-ad-client=\"ca-pub-0121577198857509\" async=\"true\" src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>\n<script>\n(function() {\n  // Molecule names in order (questions 1-15)\n  var _dcMols = [\"H\\u2082\",\"Cl\\u2082\",\"O\\u2082\",\"N\\u2082\",\"HCl\",\"OH\\u207b\",\"CN\\u207b\",\"H\\u2082O\",\"CO\\u2082\",\"NO\\u2082\\u207b\",\"NH\\u2083\",\"CH\\u2084\",\"CO\\u2083\\u00b2\\u207b\",\"H\\u2082O\\u2082\",\"SO\\u2083\\u00b2\\u207b\"];\n\n  function _dcUpdate() {\n    try {\n      var s = window._model._userSerialize();\n\n      // \u2500\u2500 Molecule info panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n      var mi = document.getElementById('dc-molinfo');\n      if (mi) {\n        var h = '';\n        h += '<div style=\"background:#fff8e1;border-left:4px solid #FF9800;padding:8px 10px;border-radius:4px;margin:6px 0;font-family:Georgia,serif\">';\n        h += '<b>\\uD83D\\uDD2C Molecule Info</b><br>';\n        h += '<b>Shape:</b> ' + (s.moleculeshape || '\\u2014');\n        h += ' &nbsp;|&nbsp; <b>Angle:</b> ' + (s.bondangle || '\\u2014');\n        h += ' &nbsp;|&nbsp; <b>Polarity:</b> ' + (s.moleculepolarity || '\\u2014') + '<br>';\n        h += '<span style=\"font-size:0.9em;color:#555\"><i>' + (s.shapedescription || '') + '</i></span>';\n        h += '</div>';\n        h += '<div style=\"background:#fce4ec;border-left:4px solid #e91e63;padding:8px 10px;border-radius:4px;margin:6px 0;font-family:Georgia,serif\">';\n        h += '<b>\\uD83C\\uDF0D Why This Matters</b><br>';\n        h += '<span style=\"font-size:0.95em\">' + (s.whythismatters || 'Select a molecule from the dropdown above.') + '</span>';\n        h += '</div>';\n        mi.innerHTML = h;\n      }\n\n      // \u2500\u2500 Progress panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n      var pr = document.getElementById('dc-progress');\n      if (pr) {\n        var _csv    = (s.starsCSV || '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0').split(',');\n        var streak  = parseInt(s.streakcount) || 0;\n        var curQ    = s.question     || 1;\n        var h = '';\n        h += '<div style=\"background:#f3e5f5;border-left:4px solid #9C27B0;padding:8px 10px;border-radius:4px;margin:6px 0;font-family:Georgia,serif\">';\n        if (streak >= 2) {\n          h += '<div style=\"background:#fff3e0;border:1px solid #FF9800;padding:4px 8px;border-radius:4px;margin-bottom:6px;font-size:0.92em\">';\n          h += '&#x1F525; <b>Streak: ' + streak + ' in a row!</b></div>';\n        }\n        h += '<b>&#x1F4CA; My Progress</b>';\n        h += '<table style=\"border-collapse:collapse;width:100%;margin-top:5px;font-size:0.88em\">';\n        h += '<tr style=\"background:#9C27B0;color:white\"><th style=\"padding:3px 8px\">Q</th><th style=\"padding:3px 8px\">Molecule</th><th style=\"padding:3px 8px\">Stars</th></tr>';\n        for (var i = 0; i < 15; i++) {\n          var bg  = (i % 2 === 0) ? '#f9f0ff' : '#fff';\n          var fw  = ((i + 1) === curQ) ? 'font-weight:bold' : '';\n          var cur = ((i + 1) === curQ) ? ' \\u25C0' : '';   // triangle marks current Q\n          h += '<tr style=\"background:' + bg + ';' + fw + '\">';\n          h += '<td style=\"text-align:center;padding:2px 6px\">' + (i+1) + '</td>';\n          h += '<td style=\"padding:2px 8px\">' + _dcMols[i] + cur + '</td>';\n          var _n = parseInt(_csv[i]) || 0;\n          var _star = _n >= 3 ? '&#x2B50;&#x2B50;&#x2B50;' : _n === 2 ? '&#x2B50;&#x2B50;' : _n === 1 ? '&#x2B50;' : '&#x25CB;';\n          h += '<td style=\"text-align:center;padding:2px 6px\">' + _star + '</td>';\n          h += '</tr>';\n        }\n        h += '</table>';\n        h += '<p style=\"font-size:0.78em;margin:5px 0 0 0\">&#x2B50;&#x2B50;&#x2B50;=1st attempt &nbsp; &#x2B50;&#x2B50;=1 wrong &nbsp; &#x2B50;=2+ wrong &nbsp; &#x25CB;=not yet</p>';\n        h += '</div>';\n        pr.innerHTML = h;\n      }\n    } catch(e) {}\n  }\n\n  function _dcStart() {\n    if (!window._model) { setTimeout(_dcStart, 300); return; }\n    setInterval(_dcUpdate, 500);   // poll every 500ms\n    setTimeout(_dcUpdate, 800);    // first update shortly after load\n  }\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', _dcStart);\n  } else {\n    _dcStart();\n  }\n})();\n</script>\n",
    "SaveInXMLFormat": "false",
    "IncludeSource": "true",
    "IncludeLibrary": "true",
    "UglifyJS": "false",
    "PreviewFullModel": "false",
    "UseInterpreter": "true",
    "UseDeltaForODE": "false"
  },
  "description": {
    "pages": []
  },
  "model": {
    "variables": {
      "pages": [
        {
          "Name": "Var Table",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "indexes",
              "Value": "1",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "teachermode",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "debug",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "fontsymbol",
              "Value": "\"normal normal 5vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "font",
              "Value": "\"normal bold 2vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "backgroundcolor",
              "Value": "\"white\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "disabled",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "errorlog",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "attempts",
              "Value": "",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "attemptq",
              "Value": "0",
              "Type": "int",
              "Dimension": "",
              "Comment": "per-question attempt counter, resets when molecule changes",
              "Domain": "public"
            },
            {
              "Name": "hintlevel1",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "vague hint shown after 1st wrong attempt",
              "Domain": "public"
            },
            {
              "Name": "hintlevel2",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "specific hint shown after 2nd wrong attempt",
              "Domain": "public"
            },
            {
              "Name": "correctexplanation",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "explanation shown in correct answer dialog",
              "Domain": "public"
            },
            {
              "Name": "mcqquestion",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "conceptual MCQ question shown after correct answer",
              "Domain": "public"
            },
            {
              "Name": "mcqanswer",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "expected answer for MCQ",
              "Domain": "public"
            },
            {
              "Name": "mcqexplanation",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "explanation shown after MCQ response",
              "Domain": "public"
            },
            {
              "Name": "xmin",
              "Value": "-3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xmax",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ymin",
              "Value": "-1.5",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ymax",
              "Value": "2.5",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "t",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "dt",
              "Value": "0.05",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "pi",
              "Value": "Math.PI",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "question",
              "Value": "1",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "whythismatters",
              "Value": "'H2 is the lightest gas and a future clean-energy carrier. Fuel cells in electric vehicles use it to generate electricity with zero CO2 emissions.'",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "moleculeshape",
              "Value": "'Linear'",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "bondangle",
              "Value": "'180 degrees'",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "shapedescription",
              "Value": "'No lone pairs - perfect symmetry along the bond axis.'",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "moleculepolarity",
              "Value": "'Non-polar'",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "streakcount",
              "Value": "0",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "starsCSV",
              "Value": "\"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "firstOxygen",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "symbol",
              "Value": "\"H\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "n",
              "Value": "32",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textanswer",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n]",
              "Comment": "arbitrary",
              "Domain": "public"
            },
            {
              "Name": "textanswernumberkey",
              "Value": "[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]",
              "Type": "double",
              "Dimension": "[n]",
              "Comment": "arbitrary",
              "Domain": "public"
            },
            {
              "Name": "angle",
              "Value": "2*pi/n",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcentre",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycentre",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcell",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycell",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xfinal",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yfinal",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "colorVectors",
              "Value": "\"rgba(255,200,0,1)\"",
              "Type": "String",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "tol",
              "Value": "_isMobile?0.3:0.3",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "occupied",
              "Value": "0",
              "Type": "int",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "radius1",
              "Value": "1",
              "Type": "Object",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "secondHydrogen 2",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "symbol2",
              "Value": "\"H\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcentre2",
              "Value": "1.3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycentre2",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "n2",
              "Value": "32",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textanswer2",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n2]",
              "Comment": "arbitrary",
              "Domain": "public"
            },
            {
              "Name": "angle2",
              "Value": "2*pi/n2",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcell2",
              "Value": "[1,Math.cos(angle),Math.cos(2*angle),Math.cos(3*angle),Math.cos(4*angle),Math.cos(5*angle)]",
              "Type": "double",
              "Dimension": "[n2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycell2",
              "Value": "[0,Math.sin(angle),Math.sin(2*angle),Math.sin(3*angle),Math.sin(4*angle),Math.sin(5*angle)]",
              "Type": "double",
              "Dimension": "[n2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xfinal2",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yfinal2",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "occupied2",
              "Value": "0",
              "Type": "int",
              "Dimension": "[n]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "colorVectors2",
              "Value": "\"rgba(255,200,0,1)\"",
              "Type": "String",
              "Dimension": "[n2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "radius2",
              "Value": "1",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "thirdAtom",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "symbol3",
              "Value": "\"H\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcentre3",
              "Value": "-1.3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycentre3",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "n3",
              "Value": "32",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textanswer3",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n3]",
              "Comment": "arbitrary",
              "Domain": "public"
            },
            {
              "Name": "angle3",
              "Value": "2*pi/n2",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcell3",
              "Value": "[1,Math.cos(angle),Math.cos(2*angle),Math.cos(3*angle),Math.cos(4*angle),Math.cos(5*angle)]",
              "Type": "double",
              "Dimension": "[n3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycell3",
              "Value": "[0,Math.sin(angle),Math.sin(2*angle),Math.sin(3*angle),Math.sin(4*angle),Math.sin(5*angle)]",
              "Type": "double",
              "Dimension": "[n3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xfinal3",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yfinal3",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "occupied3",
              "Value": "0",
              "Type": "int",
              "Dimension": "[n3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "colorVectors3",
              "Value": "\"rgba(255,200,0,1)\"",
              "Type": "String",
              "Dimension": "[n3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "radius3",
              "Value": "1",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "fourthAtom",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "symbol4",
              "Value": "\"H\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcentre4",
              "Value": "1.3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycentre4",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "n4",
              "Value": "32",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textanswer4",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n4]",
              "Comment": "arbitrary",
              "Domain": "public"
            },
            {
              "Name": "angle4",
              "Value": "2*pi/n2",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcell4",
              "Value": "[1,Math.cos(angle),Math.cos(2*angle),Math.cos(3*angle),Math.cos(4*angle),Math.cos(5*angle)]",
              "Type": "double",
              "Dimension": "[n4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycell4",
              "Value": "[0,Math.sin(angle),Math.sin(2*angle),Math.sin(3*angle),Math.sin(4*angle),Math.sin(5*angle)]",
              "Type": "double",
              "Dimension": "[n4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xfinal4",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yfinal4",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "occupied4",
              "Value": "0",
              "Type": "int",
              "Dimension": "[n4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "colorVectors4",
              "Value": "\"rgba(255,200,0,1)\"",
              "Type": "String",
              "Dimension": "[n4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "radius4",
              "Value": "1",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "fifthAtom",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "symbol5",
              "Value": "\"H\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcentre5",
              "Value": "1.3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycentre5",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "n5",
              "Value": "32",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textanswer5",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n5]",
              "Comment": "arbitrary",
              "Domain": "public"
            },
            {
              "Name": "angle5",
              "Value": "2*pi/n2",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xcell5",
              "Value": "[1,Math.cos(angle),Math.cos(2*angle),Math.cos(3*angle),Math.cos(4*angle),Math.cos(5*angle)]",
              "Type": "double",
              "Dimension": "[n5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ycell5",
              "Value": "[0,Math.sin(angle),Math.sin(2*angle),Math.sin(3*angle),Math.sin(4*angle),Math.sin(5*angle)]",
              "Type": "double",
              "Dimension": "[n5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xfinal5",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yfinal5",
              "Value": "0",
              "Type": "double",
              "Dimension": "[n5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "occupied5",
              "Value": "0",
              "Type": "int",
              "Dimension": "[n5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "colorVectors5",
              "Value": "\"rgba(255,200,0,1)\"",
              "Type": "String",
              "Dimension": "[n5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "radius5",
              "Value": "1",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "game",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "sumsharede",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede2",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede3",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede4",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede5",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede6",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede7",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumsharede8",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumpersonale",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumpersonale2",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumpersonale3",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumpersonale4",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "sumpersonale5",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "for CH4 methane",
              "Domain": "public"
            },
            {
              "Name": "trmessage",
              "Value": "\"Drag & drop the electrons into the diagram (only the outermost shells are shown). \";",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yspace",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "tmpstart",
              "Value": "2.5",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "tmpend",
              "Value": "1.5",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "tryshowanswer",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "score",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "scoreIndividual",
              "Value": "0",
              "Type": "double",
              "Dimension": "[16]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "electrons",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "sensitivity",
              "Value": "20",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "angleRadians",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "font1",
              "Value": "\"normal bold 2vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "color1",
              "Value": "\"rgba(0,0,254,1.0)\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "text1",
              "Value": "\"H has 1 valence e\u207b :   \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimals",
              "Value": "8",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimalsshow",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimals",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimalss",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimalsanimation",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimals",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimalss",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "s for store",
              "Domain": "public"
            },
            {
              "Name": "yanimalsanimation",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "imageurl",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "objectinteracted",
              "Value": "-1",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "enabledposition",
              "Value": "1",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobject",
              "Value": "[\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\"]",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobjecthints",
              "Value": "[\"egg\",\"young\",\"adult\"]",
              "Type": "String",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobjecthintsinteracted",
              "Value": "-1",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "showtextobjecthints",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "firsttime",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "feedbacktext",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "animal1",
              "Value": "false",
              "Type": "String",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "electrons 2",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "angleRadians2",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "font2",
              "Value": "\"normal bold 2vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "color2",
              "Value": "\"green\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "text2",
              "Value": "\"H has 1 valence e\u207b :   \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimalsshow2",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimals2",
              "Value": "8",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimals2",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimals2animation",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimals2animation",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimalss2",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimals2",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimalss2",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "objectinteracted2",
              "Value": "-1",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "enabledposition2",
              "Value": "1",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobject2",
              "Value": "[\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "firsttime2",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "feedbacktext2",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "electrons 3",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "font3",
              "Value": "\"normal bold 1.5vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "color3",
              "Value": "\"rgba(150,150,0,1.0)\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "text3",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimalsshow3",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimals3",
              "Value": "8",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimals3",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals3+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimals3",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals3+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimalss3",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals3+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimalss3",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals3+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "objectinteracted3",
              "Value": "-1",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "enabledposition3",
              "Value": "1",
              "Type": "double",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobject3",
              "Value": "[\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]",
              "Type": "String",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "firsttime3",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "feedbacktext3",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "electrons 4",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "font4",
              "Value": "\"normal bold 1.5vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "color4",
              "Value": "\"rgba(255,0,254,1.0)\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "text4",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimalsshow4",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimals4",
              "Value": "8",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimals4",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals4+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimals4",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals4+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimalss4",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals4+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimalss4",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals4+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "objectinteracted4",
              "Value": "-1",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "enabledposition4",
              "Value": "1",
              "Type": "double",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobject4",
              "Value": "[\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]",
              "Type": "double",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "firsttime4",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "feedbacktext4",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "electrons 5",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "",
              "Value": "",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "font5",
              "Value": "\"normal bold 1.5vw \"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "color5",
              "Value": "\"rgba(255,0,0,1.0)\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "text5",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimalsshow5",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "nanimals5",
              "Value": "8",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimals5",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals5+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimals5",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals5+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xanimalss5",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals5+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yanimalss5",
              "Value": "",
              "Type": "double",
              "Dimension": "[nanimals5+1]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "objectinteracted5",
              "Value": "-1",
              "Type": "int",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "enabledposition5",
              "Value": "1",
              "Type": "double",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "textobject5",
              "Value": "[\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"]",
              "Type": "double",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "firsttime5",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "feedbacktext5",
              "Value": "\"\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "animation",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "stop",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "stop2",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "stop3",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "stop4",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "stop5",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratex",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratey",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratex2",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratey2",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratex3",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratey3",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratex4",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratey4",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratex5",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "ratey5",
              "Value": "0",
              "Type": "double",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "collision",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "diameter",
              "Value": "0.15",
              "Type": "double",
              "Dimension": "[nanimals]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "diameter2",
              "Value": "0.15",
              "Type": "double",
              "Dimension": "[nanimals2]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "diameter3",
              "Value": "0.15",
              "Type": "double",
              "Dimension": "[nanimals3]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "diameter4",
              "Value": "0.15",
              "Type": "double",
              "Dimension": "[nanimals4]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "diameter5",
              "Value": "0.15",
              "Type": "double",
              "Dimension": "[nanimals5]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        },
        {
          "Name": "arrows",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "narrows",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "anglearrows",
              "Value": "2*pi/narrows",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xarrows",
              "Value": "[1,Math.cos(anglearrows),Math.cos(2*anglearrows),Math.cos(3*anglearrows),Math.cos(4*anglearrows),Math.cos(5*anglearrows)]",
              "Type": "double",
              "Dimension": "[narrows]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yarrows",
              "Value": "[0,Math.sin(anglearrows),Math.sin(2*anglearrows),Math.sin(3*anglearrows),Math.sin(4*anglearrows),Math.sin(5*anglearrows)]",
              "Type": "double",
              "Dimension": "[narrows]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "anglearrow",
              "Value": "",
              "Type": "double",
              "Dimension": "[narrows]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "xarrowssizex",
              "Value": "",
              "Type": "double",
              "Dimension": "[narrows]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "yarrowssizey",
              "Value": "",
              "Type": "double",
              "Dimension": "[narrows]",
              "Comment": "null",
              "Domain": "public"
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "null",
              "Domain": "public"
            }
          ]
        }
      ]
    },
    "initialization": {
      "pages": [
        {
          "Name": "steptoaddnewquestions",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "\n\n/*\nadd new custom page say laycells4atomsq13 ()\nadd new custom page say option13 ()\ncheck3atomsq13 ()\nadd new stuff to instantanswer ()\nadd in combobox\nadd in check button\n\n\n\n*/\n"
        },
        {
          "Name": "svg",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "// light blue\nvar container = document.createElement('div');\nvar svggradient = '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"><defs>'+\n  '  <radialGradient id=\"mygrandient1\" cx=\"50%\" cy=\"50%\" r=\"80%\" fx=\"50%\" fy=\"50%\">'+\n  '    <stop offset=\"0%\" style=\"stop-color:rgb(0,0,255); stop-opacity:1\" />'+\n  '    <stop offset=\"100%\" style=\"stop-color:rgb(255,255,255);stop-opacity:1\" />'+\n  '  </radialGradient>'+\n  '</defs></svg>';\ncontainer.innerHTML = svggradient;\ndocument.body.appendChild(container);\n//\"url(#mygrandient1)\"\n\n// light green\nvar container = document.createElement('div');\nvar svggradient = '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"><defs>'+\n  '  <radialGradient id=\"mygrandient2\" cx=\"50%\" cy=\"50%\" r=\"80%\" fx=\"50%\" fy=\"50%\">'+\n  '    <stop offset=\"0%\" style=\"stop-color:rgb(0,255,0); stop-opacity:1\" />'+\n  '    <stop offset=\"100%\" style=\"stop-color:rgb(155,155,155);stop-opacity:1\" />'+\n  '  </radialGradient>'+\n  '</defs></svg>';\ncontainer.innerHTML = svggradient;\ndocument.body.appendChild(container);\n//\"url(#mygrandient2)\"\n"
        },
        {
          "Name": "layelectrons",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "laycells ();\n\n//xanimals = [-2,-1.5,-1,-0.5,0,0.5,1,1.5];\nif (question==1){\n  nanimals=1;\n  nanimals2=1;\n  \n  }\n\n"
        },
        {
          "Name": "message",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "if (_isMobile){\n  //do nothing\n  }\n  \n  else{\n    // copy this into the initialization\n// make the font bigger\n\n_view.plottingPanel.getMessageDecoration(\"TL\").getFont().setFontSize(\"1vw\");\n_view.plottingPanel.getMessageDecoration(\"TR\").getFont().setFontSize(\"1vw\");\n_view.plottingPanel.getMessageDecoration(\"BL\").getFont().setFontSize(\"1vw\");\n//_view.plottingPanel.getMessageDecoration(\"BR\").getFont().setFontSize(\"1vw\");\n//alert();\n    }"
        },
        {
          "Name": "placelectrons",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "layelectrons ();"
        },
        {
          "Name": "undefined",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "//debug?\"question=\"+question+\"\\nratex=\"+ratex+\"\\nratey=\"+ratey+\"\\nstop=\"+stop:\"\"\n\nif (score==undefined){\nscore= 0;\n_tools.showOkDialog(\"Drag and drop the electrons into the diagram (only the outermost shells are shown). \");\n}\nif (attempts==undefined){\nattempts =0;\n}\nif (errorlog==undefined){\nerrorlog =\"\";\n}\n\n\n"
        },
        {
          "Name": "dialogbox",
          "Active": "false",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "document.getElementById(\".myBoxPanelOk\").style.fontSize = \"2vw\";\ndocument.getElementById(\".myBoxPanelOk\").style.color = \"Black\";\ndocument.getElementById(\".myBoxPanelOk\").style.width = \"50%\";\ndocument.getElementById(\".myBoxPanelOk\").style.left = \"30%\";\n//document.getElementById(\".myBoxPanelOk\").style.top = \"0px\";"
        }
      ]
    },
    "evolution": {
      "information": {
        "FPS": "20",
        "SPD": "1",
        "RealTimeVariable": "",
        "Autoplay": "false"
      },
      "pages": [
        {
          "Name": "Evol Page",
          "Active": "true",
          "Internal": "false",
          "Type": "ODE_EDITOR",
          "Comment": "",
          "IndependentVariable": "t",
          "Increment": "dt",
          "Equations": [
            {
              "state": "xanimals",
              "rate": "ratex"
            },
            {
              "state": "yanimals",
              "rate": "ratey"
            }
          ],
          "Method": "RungeKutta",
          "AbsoluteTolerance": "0.00001",
          "PreliminaryCode": {
            "Code": "",
            "Comment": "Code to be executed before rate equations are evaluated"
          },
          "EventMaximumStep": "",
          "Events": {
            "pages": [
              {
                "Type": "EVENT_EDITOR",
                "Name": "e0",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[0]-yanimals[0];",
                "Action": "stop[0]=1;\n\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e1",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[1]-yanimals[1];",
                "Action": "stop[1]=1;\n\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e2",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[2]-yanimals[2];",
                "Action": "stop[2]=1;\n\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e3",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[3]-yanimals[3];",
                "Action": "stop[3]=1;\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e4",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[4]-yanimals[4];",
                "Action": "stop[4]=1;\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e5",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[5]-yanimals[5];",
                "Action": "stop[5]=1;\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e6",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[6]-yanimals[6];",
                "Action": "stop[6]=1;\n\n",
                "Comment": ""
              },
              {
                "Type": "EVENT_EDITOR",
                "Name": "e7",
                "Active": "true",
                "Internal": "false",
                "EventType": "CROSSING_EVENT",
                "Method": "BISECTION",
                "Iterations": "100",
                "Tolerance": "1.0e-5",
                "StopAtEvent": "true",
                "ZeroCondition": "return yanimalsanimation[7]-yanimals[7];",
                "Action": "stop[7]=1;\n\n",
                "Comment": ""
              }
            ]
          },
          "ZenoEffect": {
            "Code": "",
            "Comment": "",
            "StopAfterEffect": "true"
          },
          "AccelerationIndependentOfVelocity": "false",
          "ForceSynchronization": "false",
          "UseBestInterpolation": "false",
          "EstimateFirstStep": "false",
          "MemoryLength": "",
          "InternalStep": "",
          "MaximumStep": "",
          "MaximumNumberOfSteps": "10000",
          "RelativeTolerance": "",
          "DelayList": "",
          "DelayMaximum": "",
          "DelayAddDiscont": "",
          "DelayInitialCondition": {
            "Code": "",
            "Comment": ""
          },
          "DirectIncidenceMatrix": "",
          "Discontinuities": {
            "pages": []
          },
          "ErrorHandling": {
            "pages": []
          }
        }
      ]
    },
    "fixed_relations": {
      "pages": [
        {
          "Name": "1rowelectron",
          "Active": "false",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//1 electrons on 1st rowelectrons\nfor (var i=0; i<objectinteracted ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals[i];\nvar dy = yanimals[objectinteracted] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter[i]/2)&&nanimalsshow==true) {\n angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals[i], xanimals[objectinteracted] - xanimals[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n   // collision detected!\n}\n}\n// cannot self check ==objectinteracted\nfor (var i=objectinteracted+1; i<nanimals ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals[i];\nvar dy = yanimals[objectinteracted] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter[i]/2)&&nanimalsshow==true) {\nangleRadians = Math.atan2(yanimals[objectinteracted] - yanimals[i], xanimals[objectinteracted] - xanimals[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n//1row electrons on 2nd rowelectrons\nfor (var i=0; i<nanimals2 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals2[i];\nvar dy = yanimals[objectinteracted] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n  angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals2[i], xanimals[objectinteracted] - xanimals2[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n//1row electrons on 3nd rowelectrons\nfor (var i=0; i<nanimals3 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals3[i];\nvar dy = yanimals[objectinteracted] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals3[i], xanimals[objectinteracted] - xanimals3[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n}\n\n}\n\n//1row electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals4[i];\nvar dy = yanimals[objectinteracted] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals4[i], xanimals[objectinteracted] - xanimals4[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n//1row electrons on 5th rowelectrons\nfor (var i=0; i<nanimals5 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals5[i];\nvar dy = yanimals[objectinteracted] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals5[i], xanimals[objectinteracted] - xanimals5[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n"
        },
        {
          "Name": "2rowelectron",
          "Active": "false",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//2 electrons on 1st rowelectrons\nfor (var i=0; i<nanimals ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals[i];\nvar dy = yanimals2[objectinteracted2] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter[i]/2)&&nanimalsshow==true) {\n    angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals[i], xanimals2[objectinteracted2] - xanimals[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n//2 electrons on 2nd rowelectrons\nfor (var i=0; i<objectinteracted2 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals2[i];\nvar dy = yanimals2[objectinteracted2] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals2[i], xanimals2[objectinteracted2] - xanimals2[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n//xanimals2[objectinteracted2]=xanimalss2[objectinteracted2]; //return to original position\n   //yanimals2[objectinteracted2]=yanimalss2[objectinteracted2]\n    // collision detected!\n}\n}\n//cannot self check\nfor (var i=objectinteracted2+1; i<nanimals2 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals2[i];\nvar dy = yanimals2[objectinteracted2] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals2[i], xanimals2[objectinteracted2] - xanimals2[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n\n\n//2 electrons on 3nd rowelectrons\nfor (var i=0; i<nanimals3 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals3[i];\nvar dy = yanimals2[objectinteracted2] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\nangleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals3[i], xanimals2[objectinteracted2] - xanimals3[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n\n}\n\n//2 electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals4[i];\nvar dy = yanimals2[objectinteracted2] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals4[i], xanimals2[objectinteracted2] - xanimals4[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n//2 electrons on 5th rowelectrons\nfor (var i=0; i<nanimals5 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals5[i];\nvar dy = yanimals2[objectinteracted2] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals5[i], xanimals2[objectinteracted2] - xanimals5[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n"
        },
        {
          "Name": "3rowelectron 2",
          "Active": "false",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//3 electrons on 1st rowelectrons\nfor (var i=0; i<nanimals ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals[i];\nvar dy = yanimals3[objectinteracted3] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter[i]/2)&&nanimalsshow==true) {\nangleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals[i], xanimals3[objectinteracted3] - xanimals[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//3 electrons on 2nd rowelectrons\nfor (var i=0; i<nanimals2 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals2[i];\nvar dy = yanimals3[objectinteracted3] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals2[i], xanimals3[objectinteracted3] - xanimals2[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//3 electrons on 3nd rowelectrons\nfor (var i=0; i<objectinteracted3 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals3[i];\nvar dy = yanimals3[objectinteracted3] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals3[i], xanimals3[objectinteracted3] - xanimals3[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n//self check !\nfor (var i=objectinteracted3+1; i<nanimals3 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals3[i];\nvar dy = yanimals3[objectinteracted3] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals3[i], xanimals3[objectinteracted3] - xanimals3[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n//3 electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals4[i], xanimals3[objectinteracted3] - xanimals4[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n//3 electrons on 5th rowelectrons\nfor (var i=0; i<nanimals5 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals5[i];\nvar dy = yanimals3[objectinteracted3] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals5[i], xanimals3[objectinteracted3] - xanimals5[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
        },
        {
          "Name": "4rowelectron 2 2",
          "Active": "false",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//4 electrons on 1st rowelectrons\nfor (var i=0; i<nanimals ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals[i];\nvar dy = yanimals4[objectinteracted4] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter[i]/2)&&nanimalsshow==true) {\n  angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals[i], xanimals4[objectinteracted4] - xanimals[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 2nd rowelectrons\nfor (var i=0; i<nanimals2 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals2[i];\nvar dy = yanimals4[objectinteracted4] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals2[i], xanimals4[objectinteracted4] - xanimals2[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 3nd rowelectrons\nfor (var i=0; i<nanimals3 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals3[i];\nvar dy = yanimals4[objectinteracted4] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals3[i], xanimals4[objectinteracted4] - xanimals3[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n//4 electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 4 rowelectrons\nfor (var i=0; i<objectinteracted4 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals4[i];\nvar dy = yanimals4[objectinteracted4] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n    angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n//! self check\nfor (var i=objectinteracted4+1; i<nanimals4 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals4[i];\nvar dy = yanimals4[objectinteracted4] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n\n//4 electrons on 5th rowelectrons\nfor (var i=0; i<nanimals5 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals5[i];\nvar dy = yanimals4[objectinteracted4] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow5==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals5[i], xanimals4[objectinteracted4] - xanimals5[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
        },
        {
          "Name": "5rowelectron 2 2 2",
          "Active": "false",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//5 electrons on 1st rowelectrons\nfor (var i=0; i<nanimals ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals[i];\nvar dy = yanimals5[objectinteracted5] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter[i]/2)&&nanimalsshow==true) {\n    angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals[i], xanimals5[objectinteracted5] - xanimals[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 2nd rowelectrons\nfor (var i=0; i<nanimals2 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals2[i];\nvar dy = yanimals5[objectinteracted5] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals2[i], xanimals5[objectinteracted5] - xanimals2[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 3nd rowelectrons\nfor (var i=0; i<nanimals3 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals3[i];\nvar dy = yanimals5[objectinteracted5] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals3[i], xanimals5[objectinteracted5] - xanimals3[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n//5 electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals4[i], xanimals5[objectinteracted5] - xanimals4[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals4[i];\nvar dy = yanimals5[objectinteracted5] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals4[i], xanimals5[objectinteracted5] - xanimals4[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n\n\n//5 electrons on 5th rowelectrons\nfor (var i=0; i<objectinteracted5 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals5[i];\nvar dy = yanimals5[objectinteracted5] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals5[i], xanimals5[objectinteracted5] - xanimals5[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//!self check\nfor (var i=objectinteracted5+1; i<nanimals5 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals5[i];\nvar dy = yanimals5[objectinteracted5] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals5[i], xanimals5[objectinteracted5] - xanimals5[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
        },
        {
          "Name": "mastercheck",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "indexchanging ();\n\n//indexes = tmp+1;\n//instantchecking (); // cannot put here, interfere with drop electrons on release"
        },
        {
          "Name": "animation",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "for (var i=0; i<8 /* Iterations */ ; i++) {\n  if(stop[i]==0){ //false\n  ratex[i] = xanimalsanimation[i] - xanimalss[i];\n  ratey[i] = yanimalsanimation[i] - yanimalss[i];\n  if (isNaN(ratex[i]))ratex[i]=0;\n  if (isNaN(ratey[i]))ratey[i]=0;\n}\nelse if (stop[0]==1){ //use only zero to control animation\n  ratex[i]=0;\n  ratey[i]=0;\n  }\n}\n"
        }
      ]
    },
    "custom": {
      "pages": [
        {
          "Name": "changeorientation",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "// code to be copied to EJSS source code under Custom and used in drawingPanel3D and plottingPanel2D\n// address the problem is height difference is iOS app , epub, and Firefox\n// user need to change only k and kepub\n// copy %changeOrientation()% into the Height Field of drawingPanel3D and plottingPanel2D\nfunction changeOrientation() {\n \nvar k =0.9 ; // k control height 1 is for full screen, 0.9 shorten etc\nvar kepub =0.9 ;\n// check platform for Apps\ntry { // allow code to run in Student Learning Space \n  var iOSapp =  (typeof parent.device != 'undefined' && parent.device.platform == \"iOS\");\n  var Androidapp = (typeof parent.device != 'undefined' && parent.device.platform == \"Android\");\n} catch(e) {\n  var iOSapp = false;\n  var Androidapp = false;\n}\n// check platform for web browsers\nvar iOS =/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nvar iPad =/iPad/.test(navigator.userAgent) && !window.MSStream;\nvar iPhone = /iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nvar Android= /Android|android/i.test(navigator.userAgent);\n\n//navigator\nvar Firefox = navigator.userAgent.indexOf(\"Firefox\") != -1;\n \nswitch (window.orientation) { // using window.orientation as deciding factor\n  case 0:\n  case 180:\n    this.screenOrientation = 'portrait';\n    if (iOSapp){ // does not seems to work\n      \n      return window.screen.height*k;  //0.1 for app and 0.1 for nonfullscreenapp  \n    \n    }\n    else if (_isEPub){ // does not seems to work\n      //   return Math.max(window.screen.width,window.screen.height)*0.9;\n      return window.innerHeight*kepub;  //0.1 for app and 0.1 for nonfullscreenapp  \n      // return window.screen.height;\n      //  return window.innerHeight;\n      // return document.documentElement.clientHeight;\n    }\n   \n    else {\n     \n      return 100*k+\"vh\";\n    }\n    break;\n  case 90:\n  case -90:\n    this.screenOrientation = 'landscape';\n \n    if (iOSapp){ // App\n      return window.screen.width*k;  \n      // return window.screen.height;\n      //  return window.innerHeight;\n      //  return document.documentElement.clientHeight;\n    }\n    else if (_isEPub){ // does not seems to work\n      //   return Math.max(window.screen.width,window.screen.height)*0.9;\n      return window.innerHeight*kepub;  //0.1 for app and 0.1 for nonfullscreenapp  \n      // return window.screen.height;\n      //  return window.innerHeight;\n      // return document.documentElement.clientHeight;\n    }\n   \n    else {\n      return 100*k+\"vh\";\n      }\n    break;\n  default:\n    this.screenOrientation = 'unknown';\n    //       return (iPad)?\"\"+(window.screen.width+window.screen.height)*0.4:((iPhone)?\"\"+window.screen.width:_view._format(window.innerHeight*0.9,\"0\"));\n     if (Firefox){\n      return window.innerHeight*k;// number as of 20180831 Firefox does not support vh yet so need a separate line to handle\n      }\n      \n      else {\n        return 100*k+\"vh\"; // string every other solid deployment, Android Android App web chrome etc\n        //console.log('hello');\n}\n\n}\n \n}"
        },
        {
          "Name": "fullscreen",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "//https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode\n// does not work for iOS \n/*jslint browser:true */\nfunction toggleFullScreen() {\n  if (!document.fullscreenElement &&    // alternative standard method\n      !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) {  // current working methods\n    if (document.documentElement.requestFullscreen) {\n      document.documentElement.requestFullscreen();\n    } else if (document.documentElement.msRequestFullscreen) {\n      document.documentElement.msRequestFullscreen();\n    } else if (document.documentElement.mozRequestFullScreen) {\n      document.documentElement.mozRequestFullScreen();\n    } else if (document.documentElement.webkitRequestFullscreen) {\n      document.documentElement.webkitRequestFullscreen();\n    }\n  } else {\n    if (document.exitFullscreen) {\n      document.exitFullscreen();\n    } else if (document.msExitFullscreen) {\n      document.msExitFullscreen();\n    } else if (document.mozCancelFullScreen) {\n      document.mozCancelFullScreen();\n    } else if (document.webkitExitFullscreen) {\n      document.webkitExitFullscreen();\n    }\n  }\n}"
        },
        {
          "Name": "laycells",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells () {\n//manually set\nxcentre=-1.3/2;\nycentre=0;\nxcentre2=1.3/2;\nycentre2=0;\n//xcentre3=-1;\n//ycentre3=-1;\nradius1=1;\nradius2=1;\n//radius3=0.8;\nymin=-1.5; // redeine ymin for back to default view\nymax = 2.5;\nfor (var i=0; i<=n  ; i++) {\n textanswer[i]=\"a\"+i;\n\nxcell[i]= xcentre+Math.sin(i*angle);\nycell[i]=ycentre+Math.cos(i*angle);\n\n  if (i*angle>pi*0.25&&i*angle<(pi*0.75)){ // straight line confuration\n  xcell[i]= 0; //zero centre\n  }\n  \n// textobject[i]= i+1;\n//xanimals[i]=Math.sin(i*angle);\n//yanimals[i]=Math.cos(i*angle);\n//xarrows[i]=Math.sin(i*angle);\n//yarrows[i]=Math.cos(i*angle);\n}\n\n\nxcell[4]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[4]=-10;\nxcell[12]= -10;\nycell[12]=-10;\n/*\nvar xdisplace = -0.15;\nangle=2*pi/n; // set angle\nxcell[0]= Math.sin(0*angle+20/180*pi);\nycell[0]=Math.cos(0*angle+20/180*pi);\nxcell[1]= Math.sin(0*angle+70/180*pi)+xdisplace;\nycell[1]=Math.cos(0*angle+70/180*pi);\nxcell[2]= Math.sin(0*angle+110/180*pi)+xdisplace;\nycell[2]=Math.cos(0*angle+110/180*pi);\nxcell[3]= Math.sin(0*angle+160/180*pi);\nycell[3]=Math.cos(0*angle+160/180*pi);\nxcell[4]= Math.sin(0*angle+200/180*pi);\nycell[4]=Math.cos(0*angle+200/180*pi);\nxcell[5]= Math.sin(0*angle+250/180*pi);\nycell[5]=Math.cos(0*angle+250/180*pi);\nxcell[6]= Math.sin(0*angle+290/180*pi);\nycell[6]=Math.cos(0*angle+290/180*pi);\nxcell[7]= Math.sin(0*angle+340/180*pi);\nycell[7]=Math.cos(0*angle+340/180*pi);\n*/\nfor (var i=0; i<=n  ; i++) {\n //textanswer[i]=i+1;\n//xcell[i]= Math.sin(i*angle+360/16/180*pi);\n//ycell[i]=Math.cos(i*angle+360/16/180*pi);\nfirsttime[i]= true; // ensure all are set to false initially after comboBox\n //textobject[i]= \"X\";\n//xanimals[i]=Math.sin(i*angle);\n//yanimals[i]=Math.cos(i*angle);\n//xarrows[i]=Math.sin(i*angle);\n//yarrows[i]=Math.cos(i*angle);\n}\n// cannot set to blank, used for correct checking\n//textobject[0]= \"\"; // set to NA\n\n//second hydrogen\n\nfor (var i=0; i<=n2  ; i++) {\n textanswer2[i]=\"b\"+i;\n\nxcell2[i]= xcentre2+Math.sin(i*angle2);\nycell2[i]=Math.cos(i*angle2);\n\n  if (i*angle2>pi*1.25&&i*angle2<(pi*1.75)){ //straight line config\n  \n  xcell2[i]= 0; //put in straight line\n  //ycell[i]= -10;\n  \n  }\n  \n// textobject[i]= i+1;\n//xanimals[i]=Math.sin(i*angle);\n//yanimals[i]=Math.cos(i*angle);\n//xarrows[i]=Math.sin(i*angle);\n//yarrows[i]=Math.cos(i*angle);\n}\n\n\nxcell2[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[20]=-10;\nxcell2[28]= -10;\nycell2[28]=-10;\n\n\n\n\n/*\nangle2=2*pi/n2; // set angle\nvar xdisplace = 1.6;\nxcell2[0]= Math.sin(0*angle2+20/180*pi)+xdisplace;\nycell2[0]=Math.cos(0*angle2+20/180*pi);\nxcell2[1]= Math.sin(0*angle2+70/180*pi)+xdisplace;\nycell2[1]=Math.cos(0*angle2+70/180*pi);\nxcell2[2]= Math.sin(0*angle2+110/180*pi)+xdisplace;\nycell2[2]=Math.cos(0*angle2+110/180*pi);\nxcell2[3]= Math.sin(0*angle2+160/180*pi)+xdisplace;\nycell2[3]=Math.cos(0*angle2+160/180*pi);\nxcell2[4]= Math.sin(0*angle2+200/180*pi)+xdisplace;\nycell2[4]=Math.cos(0*angle2+200/180*pi);\nxcell2[5]= Math.sin(0*angle2+250/180*pi)+xdisplace;\nycell2[5]=Math.cos(0*angle2+250/180*pi);\nxcell2[6]= Math.sin(0*angle2+290/180*pi)+xdisplace;\nycell2[6]=Math.cos(0*angle2+290/180*pi);\nxcell2[7]= Math.sin(0*angle2+340/180*pi)+xdisplace;\nycell2[7]=Math.cos(0*angle2+340/180*pi);\n*/\n//layelectrons\nlayelectrons ();\n\n\n\n//enabled electrons move\nfor (var i=0; i<nanimals /* Iterations */ ; i++) {\n  enabledposition[i]=\"ENABLED_ANY\";\n\n}\nfor (var i=0; i<nanimals2 /* Iterations */ ; i++) {\n  enabledposition2[i]=\"ENABLED_ANY\";\n\n}\nfor (var i=0; i<nanimals3 /* Iterations */ ; i++) {\n  enabledposition3[i]=\"ENABLED_ANY\";\n\n}\n\n//reset atoms occupied\nfor (var i=0; i<n/* Iterations */ ; i++) {\n  occupied[i]=0;\n\n}\nfor (var i=0; i<n2/* Iterations */ ; i++) {\n  occupied2[i]=0;\n\n}\n\n}"
        },
        {
          "Name": "laycells3atoms",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells3atoms () { // for water\n//manually set\nxcentre=0;\nycentre=0;\nxcentre2=1;\nycentre2=-1;\nxcentre3=-1;\nycentre3=-1;\nradius1=1;\nradius2=0.8;\nradius3=0.8;\n\nymin=-2.0; // redeine ymin for a bigger view\nymax = 2.5;\nvar factor=0.9;\n//lay firstatom\nfor (var i=0; i<=8  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nfor (var i=10; i<=14  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }  \n  // try to lay in straight line as requested\n[xcell[10],xcell[11],xcell[12],xcell[13],xcell[14]]=linspace(0.85,0.3,5);;\n[ycell[10],ycell[11],ycell[12],ycell[13],ycell[14]]=linspace(-0.30,-0.85,5);;\n\nfor (var i=18; i<=22  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n   // try to lay in straight line as requested\n[xcell[18],xcell[19],xcell[20],xcell[21],xcell[22]]=linspace(-0.30,-0.85,5);;\n[ycell[18],ycell[19],ycell[20],ycell[21],ycell[22]]=linspace(-0.85,-0.30,5);;\n\nfor (var i=24; i<=31  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n\n\n\n  \n\nxcell[9]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[9]=-10;\nxcell[15]= -10;\nycell[15]=-10;\nxcell[16]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[16]=-10;\nxcell[17]= -10;\nycell[17]=-10;\nxcell[23]= -10;\nycell[23]=-10;\n\n//lay secondtatom\nfor (var i=1; i<=23  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\nfor (var i=25; i<=31  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+factor*radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+factor*radius2*Math.cos(i*angle2);\n  }\n // try to lay in straight line as requested\n[xcell2[25],xcell2[26],xcell2[27],xcell2[28],xcell2[29]]=linspace(0.3,0.85,5);;\n[ycell2[25],ycell2[26],ycell2[27],ycell2[28],ycell2[29]]=linspace(-0.85,-0.30,5);;\n\n  \n\nxcell2[0]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[0]=-10;\nxcell2[24]= -10; \nycell2[24]=-10;\nxcell2[30]= -10;  //extra lay outside for same number of first atom\nycell2[30]=-10;\nxcell2[31]= -10; \nycell2[31]=-10;\n\n//lay thirdatom\nfor (var i=1; i<=7  ; i++) {\n textanswer3[i]=\"c\"+i;\n//xcell3[i]= xcentre3+factor*radius3*Math.sin(i*angle3);\n//ycell3[i]=ycentre3+factor*radius3*Math.cos(i*angle3);\n  }\n   // try to lay in straight line as requested\n[xcell3[1],xcell3[2],xcell3[3],xcell3[4],xcell3[5]]=linspace(-0.85,-0.3,5);;\n[ycell3[1],ycell3[2],ycell3[3],ycell3[4],ycell3[5]]=linspace(-0.3,-0.85,5);;\n\n  \nfor (var i=9; i<=n3-1  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }  \n\nxcell3[6]= -10; //extra exclusion\nycell3[6]=-10;\nxcell3[7]= -10; //extra exclusion\nycell3[7]=-10;\nxcell3[0]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell3[0]=-10;\nxcell3[8]= -10; \nycell3[8]=-10;\n\n\nlayelectrons ();\n\n}"
        },
        {
          "Name": "laycells3atomsq9",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells3atomsq9 () {\n//manually set\nxcentre=0;\nycentre=0;\nxcentre2=1.3;\nycentre2=0;\nxcentre3=-1.3;\nycentre3=0;\nradius1=1;\nradius2=1;\nradius3=1;\n\nymin=-1.5; // redeine ymin for a bigger view\nymax = 2.5;\nvar factor=0.8;\n//lay firstatom\nfor (var i=0; i<=3  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nfor (var i=5; i<=12  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\nxcell[i]= xcentre2/2;\nycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  \nfor (var i=14; i<=19  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nfor (var i=21; i<=27  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\nxcell[i]= xcentre3/2;\nycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  for (var i=29; i<=31  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  \n\nxcell[4]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[4]=-10;\nxcell[12]= -10;\nycell[12]=-10;\nxcell[13]= -10;\nycell[13]=-10;\nxcell[19]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[19]=-10;\nxcell[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[20]=-10;\nxcell[28]= -10;\nycell[28]=-10;\n\n\n//lay secondtatom\nfor (var i=0; i<=19  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\nfor (var i=21; i<=27  ; i++) {\n textanswer2[i]=\"b\"+i;\n//xcell2[i]= xcentre2+factor*radius2*Math.sin(i*angle2);\n//ycell2[i]=ycentre2+factor*radius2*Math.cos(i*angle2);\n xcell2[i]= xcentre2/2;\nycell2[i]=ycentre2+factor*radius2*Math.cos(i*angle2);\n  }\nfor (var i=29; i<=31  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\n  \n\nxcell2[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[20]=-10;\nxcell2[28]= -10; \nycell2[28]=-10;\n\n//lay thirdatom\nfor (var i=0; i<=3  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nfor (var i=5; i<=11  ; i++) {\n textanswer3[i]=\"c\"+i;\n//xcell3[i]= xcentre3+factor*radius3*Math.sin(i*angle3);\n//ycell3[i]=ycentre3+factor*radius3*Math.cos(i*angle3);\nxcell3[i]= xcentre3/2;\nycell3[i]=ycentre3+factor*radius3*Math.cos(i*angle3);\n  }  \n for (var i=13; i<=31  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\n  \nxcell3[4]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell3[4]=-10;\nxcell3[12]= -10; \nycell3[12]=-10;\n\nlayelectrons ();\n}"
        },
        {
          "Name": "laycells3atomsq11",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells3atomsq11 () {\n//manually set\nxcentre=0;\nycentre=0;\nxcentre2=1.5;\nycentre2=0;\nxcentre3=-1.5;\nycentre3=0;\nxcentre3=-1.5;\nycentre3=0;\nxcentre4=0;\nycentre4=-1.5;\nradius1=1;\nradius2=0.8;\nradius3=0.8;\nradius4=0.8;\n\nymin=-2.2; // redeine ymin for a bigger view\nymax = 2.5;\nvar factor=0.9; //use for first atom\nvar factor2=0.8; //use second, 3rd 4th atom\n//lay firstatom\nfor (var i=0; i<=4  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nfor (var i=7; i<=9  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n//xcell[i]= 0.85;\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }  \n   // try to lay in straight line as requested\n[xcell[7],xcell[8]]=linspace(0.85,0.85,2);\n[ycell[7],ycell[8]]=linspace(0.15,-0.15,2);\nxcell[9]= -10;\nycell[9]=-10;\n\nfor (var i=11; i<=13  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nxcell[11]= -10;\nycell[11]=-10; \nxcell[13]= -10;\nycell[13]=-10;\n  \nfor (var i=15; i<=17  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=-0.85;\n   }\n   // try to lay in straight line as requested\n[xcell[15],xcell[16]]=linspace(0.15,-0.15,2);\n[ycell[15],ycell[16]]=linspace(-0.85,-0.85,2);\nxcell[17]= -10;\nycell[17]=-10;\n   \n  for (var i=19; i<=21  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  xcell[19]= -10;\nycell[19]=-10;\nxcell[21]= -10;\nycell[21]=-10;\n  for (var i=23; i<=25  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n   // try to lay in straight line as requested\n[xcell[23],xcell[24]]=linspace(-0.85,-0.85,2);\n[ycell[23],ycell[24]]=linspace(-0.15,0.15,2);\nxcell[25]= -10;\nycell[25]=-10;\n\n  for (var i=27; i<=31  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  \nxcell[5]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[5]=-10;\nxcell[6]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[6]=-10;\nxcell[10]= -10;\nycell[10]=-10;\nxcell[14]= -10;\nycell[14]=-10;\nxcell[18]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[18]=-10;\nxcell[22]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[22]=-10;\nxcell[26]= -10;\nycell[26]=-10;\nxcell[27]= -10;\nycell[27]=-10;\n\n//lay secondtatom\nfor (var i=0; i<=18  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\nfor (var i=21; i<=27  ; i++) {\n textanswer2[i]=\"b\"+i;\n//xcell2[i]= xcentre2+factor2*radius2*Math.sin(i*angle2);\n//ycell2[i]=ycentre2+factor2*radius2*Math.cos(i*angle2);\n  }\n   // try to lay in straight line as requested\n[xcell2[21],xcell2[22]]=linspace(0.85,0.85,2);\n[ycell2[21],ycell2[22]]=linspace(0.15,-0.15,2);\n//extra to sync number with N\nxcell2[23]= -10; \nycell2[23]=-10;\nxcell2[24]= -10;\nycell2[24]=-10;\nxcell2[25]= -10; \nycell2[25]=-10;\nxcell2[26]= -10; \nycell2[26]=-10;\nxcell2[27]= -10; \nycell2[27]=-10;\nfor (var i=30; i<=31  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\n  \n//extra to sync number with N\n\nxcell2[19]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[19]=-10;\nxcell2[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[20]=-10;\nxcell2[28]= -10; \nycell2[28]=-10;\nxcell2[29]= -10; \nycell2[29]=-10;\n\n//lay thirdatom\nfor (var i=0; i<=2  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nfor (var i=4; i<=11  ; i++) {\n textanswer3[i]=\"c\"+i;\n//xcell3[i]= xcentre3+factor2*radius3*Math.sin(i*angle3);\n//ycell3[i]=ycentre3+factor2*radius3*Math.cos(i*angle3);\n  }  \n   // try to lay in straight line as requested\n[xcell3[4],xcell3[5]]=linspace(-0.85,-0.85,2);\n[ycell3[4],ycell3[5]]=linspace(0.15,-0.15,2);\nxcell3[6]= -10; \nycell3[6]=-10;\nxcell3[7]= -10; \nycell3[7]=-10;\nxcell3[8]= -10; \nycell3[8]=-10;\nxcell3[9]= -10; \nycell3[9]=-10;\nxcell3[10]= -10; \nycell3[10]=-10;\nxcell3[11]= -10; \nycell3[11]=-10;\n\n for (var i=14; i<=31  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nxcell3[3]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell3[3]=-10;  \nxcell3[12]= -10; \nycell3[12]=-10;\nxcell3[13]= -10; \nycell3[13]=-10;\n\n//lay fourthatom\nfor (var i=0; i<=3  ; i++) {\n textanswer4[i]=\"d\"+i;\n//xcell4[i]= xcentre4+factor2*radius4*Math.sin(i*angle4);\n//ycell4[i]=ycentre4+factor2*radius4*Math.cos(i*angle4);\n  }\n  \n  for (var i=6; i<=27  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+radius4*Math.cos(i*angle4);\n  }\n  for (var i=29; i<=31  ; i++) {\n textanswer4[i]=\"d\"+i;\n//xcell4[i]= xcentre4+factor2*radius4*Math.sin(i*angle4);\n//ycell4[i]=ycentre4+factor2*radius4*Math.cos(i*angle4);\n  }\n // try to lay in straight line as requested\n[xcell4[0],xcell4[1]]=linspace(-0.15,0.15,2);\n[ycell4[0],ycell4[1]]=linspace(-0.85,-0.85,2);\n//extra\nxcell4[2]= -10; \nycell4[2]=-10;\nxcell4[3]= -10; \nycell4[3]=-10;\nxcell4[29]= -10; \nycell4[29]=-10;\nxcell4[30]= -10; \nycell4[30]=-10;\nxcell4[31]= -10; \nycell4[31]=-10;\nxcell4[4]= -10; \nycell4[4]=-10;\nxcell4[5]= -10; \nycell4[5]=-10;\nxcell4[27]= -10; \nycell4[27]=-10;\nxcell4[28]= -10; \nycell4[28]=-10;\n\n\nlayelectrons ();\n\n}"
        },
        {
          "Name": "laycells3atomsq12",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells3atomsq12 () {\n//manually set\nxcentre=0;\nycentre=0;\nxcentre2=1.5;\nycentre2=0;\nxcentre3=-1.5;\nycentre3=0;\nxcentre3=-1.5;\nycentre3=0;\nxcentre4=0;\nycentre4=-1.5;\nxcentre5=0;\nycentre5=1.5;\nradius1=1;\nradius2=0.8;\nradius3=0.8;\nradius4=0.8;\nradius5=0.8;\n\n\nymin=-2.0; // redeine ymin for a bigger view\nymax = 3.5;\nvar factor=0.9; //use for first atom\nvar factor2=0.8; //use second, 3rd 4th atom\n//lay firstatom\nfor (var i=0; i<=1  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  // try to lay in straight line as requested\n[xcell[0],xcell[1]]=linspace(-0.15,0.15,2);\n[ycell[0],ycell[1]]=linspace(0.85,0.85,2);\n\n\n  for (var i=3; i<=5  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  xcell[3]= -10;\nycell[3]=-10;\nxcell[5]= -10;\nycell[5]=-10;\nfor (var i=7; i<=9  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }  \n  // try to lay in straight line as requested\n[xcell[7],xcell[8]]=linspace(0.85,0.85,2);\n[ycell[7],ycell[8]]=linspace(0.15,-0.15,2);\nxcell[9]= -10;\nycell[9]=-10;\n\n\nfor (var i=11; i<=13  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  xcell[11]= -10;\nycell[11]=-10;\nxcell[13]= -10;\nycell[13]=-10;\nfor (var i=15; i<=17  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\nycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  \n  // try to lay in straight line as requested\n[xcell[15],xcell[16]]=linspace(0.15,-0.15,2);\n[ycell[15],ycell[16]]=linspace(-0.85,-0.85,2);\nxcell[17]= -10;\nycell[17]=-10;\n  for (var i=19; i<=21  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  xcell[19]= -10;\nycell[19]=-10;\nxcell[21]= -10;\nycell[21]=-10;\n  for (var i=23; i<=25  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  // try to lay in straight line as requested\n  [xcell[23],xcell[24]]=linspace(-0.85,-0.85,2);\n[ycell[23],ycell[24]]=linspace(-0.15,0.15,2);\nxcell[25]= -10;\nycell[25]=-10;\n  for (var i=27; i<=29  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  xcell[27]= -10;\nycell[27]=-10;\nxcell[29]= -10;\nycell[29]=-10;\n  for (var i=31; i<=31  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  xcell[31]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[31]=-10;\nxcell[2]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[2]=-10;\nxcell[6]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[6]=-10;\nxcell[10]= -10;\nycell[10]=-10;\nxcell[14]= -10;\nycell[14]=-10;\nxcell[18]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[18]=-10;\nxcell[22]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[22]=-10;\nxcell[26]= -10;\nycell[26]=-10;\nxcell[30]= -10;\nycell[30]=-10;\n\n//lay secondtatom\nfor (var i=0; i<=18  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\nfor (var i=21; i<=27  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+factor2*radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+factor2*radius2*Math.cos(i*angle2);\n  }\n  // try to lay in straight line as requested\n  [xcell2[21],xcell2[22]]=linspace(0.85,0.85,2);\n[ycell2[21],ycell2[22]]=linspace(0.15,-0.15,2);\nxcell2[23]= -10;\nycell2[23]=-10;\nxcell2[24]= -10;\nycell2[24]=-10;\nxcell2[25]= -10;\nycell2[25]=-10;\nxcell2[26]= -10;\nycell2[26]=-10;\nxcell2[27]= -10;\nycell2[27]=-10;\nfor (var i=30; i<=31  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\n  \n\nxcell2[19]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[19]=-10;\nxcell2[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[20]=-10;\nxcell2[28]= -10; \nycell2[28]=-10;\nxcell2[29]= -10; \nycell2[29]=-10;\n\n//lay thirdatom\nfor (var i=0; i<=2  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nfor (var i=4; i<=11  ; i++) {\n textanswer3[i]=\"c\"+i;\n//xcell3[i]= xcentre3+factor2*radius3*Math.sin(i*angle3);\n//ycell3[i]=ycentre3+factor2*radius3*Math.cos(i*angle3);\n  }  \n  // try to lay in straight line as requested\n  [xcell3[4],xcell3[5]]=linspace(-0.85,-0.85,2);\n[ycell3[4],ycell3[5]]=linspace(0.15,-0.15,2);\nxcell3[6]= -10;\nycell3[6]=-10;\nxcell3[7]= -10;\nycell3[7]=-10;\nxcell3[8]= -10;\nycell3[8]=-10;\nxcell3[9]= -10;\nycell3[9]=-10;\nxcell3[10]= -10;\nycell3[10]=-10;\nxcell3[11]= -10;\nycell3[11]=-10;\n for (var i=14; i<=31  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nxcell3[3]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell3[3]=-10;  \n\nxcell3[12]= -10; \nycell3[12]=-10;\nxcell3[13]= -10; \nycell3[13]=-10;\n\n//lay fourthatom\nfor (var i=0; i<=3  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+factor2*radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+factor2*radius4*Math.cos(i*angle4);\n  }\n  // try to lay in straight line as requested\n  [xcell4[0],xcell4[1]]=linspace(-0.15,0.15,2);\n[ycell4[0],ycell4[1]]=linspace(-0.85,-0.85,2);\n  xcell4[2]= -10; \nycell4[2]=-10;\n  xcell4[3]= -10; \nycell4[3]=-10;\n\n  for (var i=6; i<=27  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+radius4*Math.cos(i*angle4);\n  }\n  for (var i=29; i<=31  ; i++) {\n textanswer4[i]=\"d\"+i;\n//xcell4[i]= xcentre4+factor2*radius4*Math.sin(i*angle4);\n//ycell4[i]=ycentre4+factor2*radius4*Math.cos(i*angle4);\n  }\n xcell4[29]= -10; \nycell4[29]=-10;\n xcell4[30]= -10; \nycell4[30]=-10;\n xcell4[31]= -10; \nycell4[31]=-10;\n\nxcell4[4]= -10; \nycell4[4]=-10;\nxcell4[5]= -10; \nycell4[5]=-10;\nxcell4[27]= -10; \nycell4[27]=-10;\nxcell4[28]= -10; \nycell4[28]=-10;\n\n//lay fifthatom\nfor (var i=0; i<=9  ; i++) {\n textanswer5[i]=\"e\"+i;\nxcell5[i]= xcentre5+radius5*Math.sin(i*angle5);\nycell5[i]=ycentre5+radius5*Math.cos(i*angle5);\n  }\n  for (var i=12; i<=20  ; i++) {\n textanswer5[i]=\"e\"+i;\n//xcell5[i]= xcentre5+factor2*radius5*Math.sin(i*angle5);\n//ycell5[i]=ycentre5+factor2*radius5*Math.cos(i*angle5);\n  }\n   // try to lay in straight line as requested\n  [xcell5[12],xcell5[13]]=linspace(0.15,-0.15,2);\n[ycell5[12],ycell5[13]]=linspace(0.85,0.85,2);\n \n xcell5[14]= -10; \nycell5[14]=-10;\n xcell5[15]= -10; \nycell5[15]=-10;\n xcell5[16]= -10; \nycell5[16]=-10;\n xcell5[17]= -10; \nycell5[17]=-10;\n xcell5[18]= -10; \nycell5[18]=-10;\n xcell5[19]= -10; \nycell5[19]=-10;\n xcell5[20]= -10; \nycell5[20]=-10;\n\n\n  for (var i=23; i<=31  ; i++) {\n textanswer5[i]=\"e\"+i;\nxcell5[i]= xcentre5+radius5*Math.sin(i*angle5);\nycell5[i]=ycentre5+radius5*Math.cos(i*angle5);\n  }\nxcell5[10]= -10; \nycell5[10]=-10;\nxcell5[11]= -10; \nycell5[11]=-10;\nxcell5[21]= -10; \nycell5[21]=-10;\nxcell5[22]= -10; \nycell5[22]=-10;\n\n\nlayelectrons ();\n}//function"
        },
        {
          "Name": "laycells4atomsq13CO32- 2",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells4atomsq13 () { //same as q15 yih check\n//manually set\nvar r =1.4;\nxcentre=0;\nycentre=0;\nxcentre2=r*Math.cos((90-120)/180*pi);\nycentre2=r*Math.sin((90-120)/180*pi);\nxcentre3=r*Math.cos((90+120)/180*pi);\nycentre3=r*Math.sin((90+120)/180*pi);\nxcentre4=0;\nycentre4=r;\nradius1=1;\nradius2=1;\nradius3=1;\nradius4=1;\n\nymin=-2.0; // redeine ymin for a bigger view\nymax = 3.5;\n\nvar factor=0.8;\n//lay firstatom\nfor (var i=0; i<=2  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\nycell[i]= 0.7;\n  }\n  // try to lay in straight line as requested\n[xcell[30],xcell[31],xcell[0],xcell[1]]=linspace(-0.5,0.5,4);\n[ycell[30],ycell[31],ycell[0],ycell[1]]=linspace(0.7,0.7,4);\nxcell[2]= -10;\nycell[2]=-10;\nxcell[3]= -10;\nycell[3]=-10; \n\nfor (var i=5; i<=6  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }  \nfor (var i=8; i<=14  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n   // try to lay in straight line as requested\n[xcell[8],xcell[9],xcell[10],xcell[11]]=linspace(0.85,0.35,4);\n[ycell[8],ycell[9],ycell[10],ycell[11]]=linspace(0,-0.7,4);\nxcell[12]= -10;\nycell[12]=-10;\nxcell[13]= -10;\nycell[13]=-10;\nxcell[14]= -10;\nycell[14]=-10;\n \nfor (var i=15; i<=16  ; i++) {\n textanswer[i]=\"a\"+i;\n var adjustment =0.1; //to yih check request\nxcell[i]= xcentre+radius1*Math.sin(i*angle+adjustment);\nycell[i]=ycentre+radius1*Math.cos(i*angle+adjustment);\n  }\n  for (var i=19; i<=24  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  // try to lay in straight line as requested\n[xcell[19],xcell[20],xcell[21],xcell[22]]=linspace(-0.35,-0.85,4);\n[ycell[19],ycell[20],ycell[21],ycell[22]]=linspace(-0.7,-0,4);\nxcell[23]= -10;\nycell[23]=-10;\nxcell[24]= -10;\nycell[24]=-10;\n\n for (var i=26; i<=27  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n  for (var i=29; i<=31  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  } \n  \nxcell[29]= -10;\nycell[29]=-10;\nxcell[4]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[4]=-10;\nxcell[7]= -10;\nycell[7]=-10;\n//xcell[15]= -10; // to yih check 2 dots instead of 1\n//ycell[15]=-10;\nxcell[17]= -10;\nycell[17]=-10;\nxcell[18]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[18]=-10;\nxcell[25]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[25]=-10;\nxcell[28]= -10;\nycell[28]=-10;\n\n\n//lay secondtatom\nfor (var i=0; i<=22  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\nfor (var i=24; i<=30  ; i++) {\n textanswer2[i]=\"b\"+i;\n//xcell2[i]= xcentre2+factor*radius2*Math.sin(i*angle2);\n//ycell2[i]=ycentre2+factor*radius2*Math.cos(i*angle2);\n  }\n// try to lay in straight line as requested\n[xcell2[24],xcell2[25],xcell2[26],xcell2[27]]=linspace(0.85,0.35,4);\n[ycell2[24],ycell2[25],ycell2[26],ycell2[27]]=linspace(0,-0.7,4);\nxcell2[28]= -10;\nycell2[28]=-10;\nxcell2[29]= -10;\nycell2[29]=-10;\nxcell2[30]= -10;\nycell2[30]=-10;\n  \n\nxcell2[23]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[23]=-10;\nxcell2[31]= -10; \nycell2[31]=-10;\n\n//lay thirdatom\nfor (var i=0; i<=0  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nfor (var i=2; i<=8  ; i++) {\n textanswer3[i]=\"c\"+i;\n//xcell3[i]= xcentre3+factor*radius3*Math.sin(i*angle3);\n//ycell3[i]=ycentre3+factor*radius3*Math.cos(i*angle3);\n  }  \n  //straight line\n  [xcell3[2],xcell3[3],xcell3[4],xcell3[5]]=linspace(-0.85,-0.35,4);\n[ycell3[2],ycell3[3],ycell3[4],ycell3[5]]=linspace(0,-0.7,4);\nxcell3[28]= -10;\nycell3[28]=-10;\n\n for (var i=10; i<=31  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\n  \nxcell3[1]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell3[1]=-10;\nxcell3[9]= -10; \nycell3[9]=-10;\n\n//lay fourthatom\nfor (var i=0; i<=11  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+radius4*Math.cos(i*angle4);\n  }\n  for (var i=13; i<=19  ; i++) {\n textanswer4[i]=\"d\"+i;\n//xcell4[i]= xcentre4+factor*radius4*Math.sin(i*angle4);\n//ycell4[i]=ycentre4+factor*radius4*Math.cos(i*angle4);\n  }\n  //straight line\n  [xcell4[13],xcell4[14],xcell4[15],xcell4[16]]=linspace(0.5,-0.5,4);\n[ycell4[13],ycell4[14],ycell4[15],ycell4[16]]=linspace(0.7,0.7,4);\nxcell4[17]= -10;\nycell4[17]=-10;\n xcell4[18]= -10;\nycell4[18]=-10;\nxcell4[19]= -10;\nycell4[19]=-10;\n  \n  for (var i=21; i<=31  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+radius4*Math.cos(i*angle4);\n  }\n\nxcell4[12]= -10; \nycell4[12]=-10;\nxcell4[20]= -10; \nycell4[20]=-10;\n\n\nlayelectrons ();\n\n\n}//function\n\n\n\n"
        },
        {
          "Name": "laycells4atomsq14",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function laycells4atomsq14 () {\n//manually set\nvar r =1.4;\nxcentre=-0.7;\nycentre=0;\nxcentre2=0.7;\nycentre2=0;\nxcentre3=-2.1;\nycentre3=0;\nxcentre4=2.1;\nycentre4=0;\nradius1=1;\nradius2=1;\nradius3=0.8;\nradius4=0.8;\n\nymin=-2.0; // redeine ymin for a bigger view\nymax = 2.5;\n\nvar factor=0.8;\n//lay firstatom\nfor (var i=0; i<=3  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nfor (var i=5; i<=11  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  } \n  // try to lay in straight line as requested\n[xcell[5],xcell[6],xcell[7],xcell[8]]=linspace(0,0,4);\n[ycell[5],ycell[6],ycell[7],ycell[8]]=linspace(0.35,-0.35,4);\nxcell[9]= -10;\nycell[9]=-10;\nxcell[10]= -10;\nycell[10]=-10;\nxcell[11]= -10;\nycell[11]=-10;\n\nfor (var i=13; i<=19  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\nfor (var i=21; i<=27  ; i++) {\n textanswer[i]=\"a\"+i;\n//xcell[i]= xcentre+factor*radius1*Math.sin(i*angle);\n//ycell[i]=ycentre+factor*radius1*Math.cos(i*angle);\n  }\n  // try to lay in straight line as requested\n[xcell[21],xcell[22],xcell[23],xcell[24]]=linspace(-1.5,-1.5,4);\n[ycell[21],ycell[22],ycell[23],ycell[24]]=linspace(0.35,-0.35,4);\nxcell[25]= -10;\nycell[25]=-10;\nxcell[26]= -10;\nycell[26]=-10;\nxcell[27]= -10;\nycell[27]=-10;\n\n  for (var i=29; i<=31  ; i++) {\n textanswer[i]=\"a\"+i;\nxcell[i]= xcentre+radius1*Math.sin(i*angle);\nycell[i]=ycentre+radius1*Math.cos(i*angle);\n  }\n \n  \n\nxcell[4]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[4]=-10;\nxcell[12]= -10;\nycell[12]=-10;\nxcell[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell[20]=-10;\nxcell[28]= -10;\nycell[28]=-10;\n\n\n//lay secondtatom\nfor (var i=0; i<=3  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\nfor (var i=5; i<=11  ; i++) {\n textanswer2[i]=\"b\"+i;\n//xcell2[i]= xcentre2+factor*radius2*Math.sin(i*angle2);\n//ycell2[i]=ycentre2+factor*radius2*Math.cos(i*angle2);\n  }\n  // try to lay in straight line as requested\n[xcell2[5],xcell2[6],xcell2[7],xcell2[8]]=linspace(1.5,1.5,4);\n[ycell2[5],ycell2[6],ycell2[7],ycell2[8]]=linspace(0.35,-0.35,4);\nxcell2[9]= -10;\nycell2[9]=-10;\nxcell2[10]= -10;\nycell2[10]=-10;\nxcell2[11]= -10;\nycell2[11]=-10;\n\n\nfor (var i=13; i<=19  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\n  for (var i=21; i<=27  ; i++) {\n textanswer2[i]=\"b\"+i;\n//xcell2[i]= xcentre2+factor*radius2*Math.sin(i*angle2);\n//ycell2[i]=ycentre2+factor*radius2*Math.cos(i*angle2);\n  }\n   // try to lay in straight line as requested\n[xcell2[21],xcell2[22],xcell2[23],xcell2[24]]=linspace(0,0,4);\n[ycell2[21],ycell2[22],ycell2[23],ycell2[24]]=linspace(0.35,-0.35,4);\nxcell2[25]= -10;\nycell2[25]=-10;\nxcell2[26]= -10;\nycell2[26]=-10;\nxcell2[27]= -10;\nycell2[27]=-10;\n\nfor (var i=29; i<=31  ; i++) {\n textanswer2[i]=\"b\"+i;\nxcell2[i]= xcentre2+radius2*Math.sin(i*angle2);\nycell2[i]=ycentre2+radius2*Math.cos(i*angle2);\n  }\n  \nxcell2[4]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[4]=-10;\nxcell2[12]= -10; \nycell2[12]=-10;\nxcell2[20]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell2[20]=-10;\nxcell2[28]= -10; \nycell2[28]=-10;\n\n//lay thirdatom\nfor (var i=0; i<=2  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\nfor (var i=4; i<=12  ; i++) {\n textanswer3[i]=\"c\"+i;\n//xcell3[i]= xcentre3+factor*radius3*Math.sin(i*angle3);\n//ycell3[i]=ycentre3+factor*radius3*Math.cos(i*angle3);\n  }  \n  // try to lay in straight line as requested\n[xcell3[4],xcell3[5],xcell3[6],xcell3[7]]=linspace(-1.5,-1.5,4);\n[ycell3[4],ycell3[5],ycell3[6],ycell3[7]]=linspace(0.35,-0.35,4);\nxcell3[8]= -10;\nycell3[8]=-10;\nxcell3[9]= -10;\nycell3[9]=-10;\nxcell3[10]= -10;\nycell3[10]=-10;\nxcell3[11]= -10;\nycell3[11]=-10;\nxcell3[12]= -10;\nycell3[12]=-10;\n\n\n\n for (var i=14; i<=31  ; i++) {\n textanswer3[i]=\"c\"+i;\nxcell3[i]= xcentre3+radius3*Math.sin(i*angle3);\nycell3[i]=ycentre3+radius3*Math.cos(i*angle3);\n  }\n  \nxcell3[3]= -10; //to be excluded from drawing as they are too close to the intersection to be considered as shared or solo\nycell3[3]=-10;\nxcell3[13]= -10; \nycell3[13]=-10;\n\n//lay fourthatom\nfor (var i=0; i<=18  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+radius4*Math.cos(i*angle4);\n  }\n  for (var i=20; i<=28  ; i++) {\n textanswer4[i]=\"d\"+i;\n//xcell4[i]= xcentre4+factor*radius4*Math.sin(i*angle4);\n//ycell4[i]=ycentre4+factor*radius4*Math.cos(i*angle4);\n  }\n   // try to lay in straight line as requested\n[xcell4[20],xcell4[21],xcell4[22],xcell4[23]]=linspace(1.5,1.5,4);\n[ycell4[20],ycell4[21],ycell4[22],ycell4[23]]=linspace(0.35,-0.35,4);\nxcell4[24]= -10;\nycell4[24]=-10;\nxcell4[25]= -10;\nycell4[25]=-10;\nxcell4[26]= -10;\nycell4[26]=-10;\nxcell4[27]= -10;\nycell4[27]=-10;\nxcell4[28]= -10;\nycell4[28]=-10;\n\n  for (var i=30; i<=31  ; i++) {\n textanswer4[i]=\"d\"+i;\nxcell4[i]= xcentre4+radius4*Math.sin(i*angle4);\nycell4[i]=ycentre4+radius4*Math.cos(i*angle4);\n  }\n\nxcell4[19]= -10; \nycell4[19]=-10;\nxcell4[29]= -10; \nycell4[29]=-10;\n\n\nlayelectrons ();\n\n\n}//function\n\n\n\n"
        },
        {
          "Name": "checkHint",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "Progressive 3-level hint function for wrong answers",
          "Code": "function checkHint (qnum) {\n  attemptq++;\n  _view.audio2.play(); // wrong ding\n  if (attemptq == 1) {\n    _tools.showOkDialog(\"Q\" + qnum + \" Incorrect \u2014 try again!\\n\\nHint: \" + hintlevel1);\n  } else if (attemptq == 2) {\n    _tools.showOkDialog(\"Q\" + qnum + \" Incorrect (2nd attempt).\\n\\nSpecific hint: \" + hintlevel2);\n  } else {\n    _tools.showOkDialog(\"Q\" + qnum + \" Incorrect (attempt \" + attemptq + \").\\n\\n\" + hintlevel2 + \"\\n\\nHint exhausted \u2014 consider resetting and trying again.\", function(){\n      tryshowanswer = true;\n      _update();\n    });\n  }\n}"
        },
        {
          "Name": "showCorrectWithMCQ",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "Shows correct dialog with explanation then a conceptual MCQ then calls advance function",
          "Code": "function showCorrectWithMCQ (advanceFn) {\n  computeStars(); // update stars + streak\n  _view.audio.play(); // good ding\n  _tools.showOkDialog(\"Correct! \" + correctexplanation, function(){\n    _tools.showInputDialog(mcqquestion, \"\", function(studentanswer){\n      var mcqfeedback;\n      if (studentanswer !== null && studentanswer.trim().toLowerCase() == mcqanswer.toLowerCase()) {\n        mcqfeedback = \"Correct! \" + mcqexplanation;\n      } else if (studentanswer === null || studentanswer.trim() === \"\") {\n        mcqfeedback = \"The answer is: \" + mcqanswer + \". \" + mcqexplanation;\n      } else {\n        mcqfeedback = \"Not quite \u2014 the answer is: \" + mcqanswer + \". \" + mcqexplanation;\n      }\n      _tools.showOkDialog(mcqfeedback, advanceFn);\n    });\n  });\n}"
        },
        {
          "Name": "option1",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option1 () {\nquestion=1;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n   nanimals=1;\n   nanimals2=1;\n   textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n   \n    nanimalsshow3=false;\n    nanimalsshow4=false;\n    nanimalsshow5=false;\n   nanimals3=0;\n   symbol=\"H\";\n   symbol2=\"H\";\n   text1= \"H has 1 valence e\u207b :\";\n   text2= \"H has 1 valence e\u207b :\";\n   text3= \"\";\n   text4= \"\";\n   text5= \"\";\n   trmessage = \"H\u2082 \u2014 Hydrogen molecule | H: 1 valence e\u207b (needs 1 more to be like He) | Single bond, no lone pairs | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"H has only 1 valence electron. How many more does it need to be like helium (2 electrons total)?\";\n   hintlevel2 = \"Place 1 dot in the shared region for H atom 1, and 1 cross for H atom 2. H has no lone pairs \u2014 all electrons are shared.\";\n   correctexplanation = \"H\u2082 has 1 bonding pair (single bond). Both H atoms now have 2 electrons \u2014 like helium (stable duplet).\";\n   mcqquestion = \"Conceptual check: How many bonding pairs does H\u2082 have?\\nType 1, 2, or 3\";\n   mcqanswer = \"1\";\n   mcqexplanation = \"H\u2082 has 1 bonding pair (single bond). Both H atoms achieve the stable duplet with 2 electrons each.\";\n\n   \n  whythismatters = 'H2 is the lightest gas and a future clean-energy carrier. Fuel cells in electric vehicles use it to generate electricity with zero CO2 emissions.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = 'No lone pairs - perfect symmetry along the bond axis.';\n  moleculepolarity = 'Non-polar';\n}\n"
        },
        {
          "Name": "option2",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option2 () {\nquestion=2;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n  nanimals=7;\n  nanimals2=7;\n   nanimalsshow3=false;\n   nanimalsshow4=false;\n   nanimalsshow5=false;\n   nanimals3=0;\n   symbol=\"Cl\";\n   symbol2=\"Cl\";\n   text1= \"Cl has 7 valence e\u207b :\";\n   text2= \"Cl has 7 valence e\u207b :\";\n   text3= \"\";\n   text4= \"\";\n   text5= \"\";\n   trmessage = \"Cl\u2082 \u2014 Chlorine molecule | Cl: 7 valence e\u207b (needs 1 more) | Single bond, 3 lone pairs on each Cl | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"Cl has 7 valence electrons. How many more does Cl need to complete its octet (8 electrons)?\";\n   hintlevel2 = \"Place 1 dot in the shared region for Cl1, 1 cross for Cl2. Each Cl keeps 6 electrons as 3 lone pairs.\";\n   correctexplanation = \"Cl\u2082 has 1 bonding pair (single bond). Each Cl has 3 lone pairs and shares 1 electron with the other.\";\n   mcqquestion = \"Conceptual check: How many lone pairs does each Cl atom have in Cl\u2082?\\nType 1, 2, or 3\";\n   mcqanswer = \"3\";\n   mcqexplanation = \"Each Cl has 3 lone pairs (6 non-bonding electrons). Together with the shared pair, each Cl has 8 electrons \u2014 the octet.\";\n\n  // _view.comboBox.setSelectedOptions([\"chlorine molecule, Cl\u2082\"]);\n   \n  whythismatters = 'Cl2 purifies drinking water and swimming pools. It also manufactures PVC plastic, one of the most widely used materials in construction.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = '3 lone pairs on each Cl; symmetrical single bond gives a linear shape.';\n  moleculepolarity = 'Non-polar';\n}\n"
        },
        {
          "Name": "option3",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option3 () {\nquestion=3;\n   font1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n   nanimals=6;\n  nanimals2=6;\n  nanimalsshow3=false;\n  nanimalsshow4=false;\n  nanimalsshow5=false;\n   nanimals3=0;\n   symbol=\"O\";\n   symbol2=\"O\";\n    text1= \"O has 6 valence e\u207b :\";\n   text2= \"O has 6 valence e\u207b :\";\n   text3= \"\";\n   text4= \"\";\n   text5= \"\";\n  trmessage = \"O\u2082 \u2014 Oxygen molecule | O: 6 valence e\u207b (needs 2 more) | Double bond, 2 lone pairs on each O | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"O has 6 valence electrons. How many more does O need? What type of bond does this create?\";\n   hintlevel2 = \"Place 2 dots in the shared region for O1, and 2 crosses for O2 (double bond). Each O keeps 4 electrons as 2 lone pairs.\";\n   correctexplanation = \"O\u2082 has a double bond (2 bonding pairs). Each O has 2 lone pairs. This makes O\u2082 a reactive gas.\";\n   mcqquestion = \"Conceptual check: What type of bond is in O\u2082?\\nType: single, double, or triple\";\n   mcqanswer = \"double\";\n   mcqexplanation = \"O\u2082 has a double bond \u2014 2 shared electron pairs. Both O atoms complete their octets (8 electrons each).\";\n\n // textanswer=[1,2,3];\n //  _view.comboBox.setSelectedOptions([\"chlorine molecule, Cl\u2082\"]);\n   \n  whythismatters = 'Every breath you take uses O2. Your mitochondria split its double bond to release energy that powers every cell in your body.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = '2 lone pairs on each O; the double bond and symmetry give a linear shape.';\n  moleculepolarity = 'Non-polar';\n}\n"
        },
        {
          "Name": "option4",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option4 () {\nquestion=4;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n   nanimals=5;\n  nanimals2=5;\n  nanimalsshow3=false;\n  nanimalsshow4=false;\n  nanimalsshow5=false;\n   nanimals3=0;\n   symbol=\"N\";\n   symbol2=\"N\";\n    text1= \"N has 5 valence e\u207b :\";\n   text2= \"N has 5 valence e\u207b :\";\n   text3= \"\";\n   text4= \"\";\n   text5= \"\";\n   trmessage = \"N\u2082 \u2014 Nitrogen molecule | N: 5 valence e\u207b (needs 3 more) | Triple bond, 1 lone pair on each N | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"N has 5 valence electrons. How many more does N need? This leads to the strongest diatomic bond.\";\n   hintlevel2 = \"Place 3 dots in the shared region for N1, 3 crosses for N2 (triple bond). Each N keeps 2 electrons as 1 lone pair.\";\n   correctexplanation = \"N\u2082 has a triple bond (3 bonding pairs) \u2014 the strongest diatomic bond. Each N has 1 lone pair.\";\n   mcqquestion = \"Conceptual check: What type of bond is in N\u2082?\\nType: single, double, or triple\";\n   mcqanswer = \"triple\";\n   mcqexplanation = \"N\u2082 has a triple bond \u2014 3 shared electron pairs. This very strong bond makes N\u2082 unreactive at room temperature.\";\n\n   \n  whythismatters = 'N2\\'s triple bond is one of the strongest in chemistry. That is why 78% of the air you breathe does not react, keeping atmospheric conditions stable for life.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = '1 lone pair on each N; triple bond + symmetry give a linear shape.';\n  moleculepolarity = 'Non-polar';\n}\n"
        },
        {
          "Name": "option5",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option5 () {\nquestion=5;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n   nanimals=1;\n  nanimals2=7;\n   nanimalsshow3=false;\n   nanimalsshow4=false;\n   nanimalsshow5=false;\n   nanimals3=0;\n   symbol=\"H\";\n   symbol2=\"Cl\";\n    text1= \"H has 1 valence e\u207b :\";\n   text2= \"Cl has 7 valence e\u207b :\";\n   text3= \"\";\n   text4= \"\";\n   text5= \"\";\n  trmessage = \"HCl \u2014 Hydrogen chloride | H: 1 valence e\u207b, Cl: 7 valence e\u207b | Single bond, 3 lone pairs on Cl only | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"H needs 1 more electron; Cl needs 1 more electron. How many pairs of electrons are shared between them?\";\n   hintlevel2 = \"Place 1 dot (from H) and 1 cross (from Cl) in the shared region. H has no lone pairs; Cl keeps 6 electrons as 3 lone pairs.\";\n   correctexplanation = \"HCl has 1 bonding pair (single bond). H has no lone pairs; Cl has 3 lone pairs. HCl is a polar molecule.\";\n   mcqquestion = \"Conceptual check: Which atom in HCl has lone pairs?\\nType: H, Cl, or both\";\n   mcqanswer = \"Cl\";\n   mcqexplanation = \"Only Cl has lone pairs (3 pairs = 6 electrons). H uses all its electrons in the shared bond with Cl.\";\n\n   \n  whythismatters = 'HCl dissolves in water to form hydrochloric acid, the same acid your stomach uses to digest food and kill harmful bacteria.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = '3 lone pairs on Cl, none on H. Cl is more electronegative, so the bond dipole points toward Cl.';\n  moleculepolarity = 'Polar';\n}\n"
        },
        {
          "Name": "option6",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option6 () { //OH-\n question=6;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n   nanimals=6;\n  nanimals2=1;\n nanimalsshow3=true;\n nanimalsshow4=false;\n nanimalsshow5=false;\n   nanimals3=0;\n   symbol=\"O\";\n   symbol2=\"H\";\n   textobject3= [\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"];\n    text1= \"O has 6 valence e\u207b :\";\n   text2= \"H has 1 valence e\u207b :\";\n   text3= \"There is 1 foreign e\u207b :\";\n   text4= \"\";\n   text5= \"\";\n   trmessage = \"OH\u207b \u2014 Hydroxide ion | O: 6 valence e\u207b + 1 extra from 1- charge, H: 1 valence e\u207b | Single O-H bond, 3 lone pairs on O | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"OH\u207b has a 1- charge \u2014 there is 1 extra electron on O. O bonds with 1 H atom. How many lone pairs does O have?\";\n   hintlevel2 = \"Place 1 shared pair between O and H. O keeps the remaining electrons (including the extra one from the 1- charge) as 3 lone pairs.\";\n   correctexplanation = \"OH\u207b has 1 bonding pair (O-H bond). O has 3 lone pairs \u2014 the extra electron from the 1- charge stays on O.\";\n   mcqquestion = \"Conceptual check: How many lone pairs does O have in OH\u207b?\\nType 1, 2, or 3\";\n   mcqanswer = \"3\";\n   mcqexplanation = \"O in OH\u207b has 3 lone pairs (6 non-bonding electrons). The extra electron from the 1- charge is on the O atom.\";\n\n   \n  whythismatters = 'OH- is what makes bases like bleach (NaOH solution) corrosive. It is the ion responsible for all alkaline properties in aqueous solution.';\n  moleculeshape = 'Bent (~109 degrees)';\n  bondangle = '~109 degrees';\n  shapedescription = '3 lone pairs on O push away from H, giving a bent-like geometry around O.';\n  moleculepolarity = 'Ion (charged)';\n}\n"
        },
        {
          "Name": "option7",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option7 () {\n question=7;\n font1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n  nanimals=4;\n  nanimals2=5;\n  nanimalsshow3=true;\n  nanimalsshow4=false;\n  nanimalsshow5=false;\n   nanimals3=1;\n   symbol=\"C\";\n   symbol2=\"N\";\n   textobject3= [\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"];\n  // symbol3=\"O\";\n   text1= \"C has 4 valence e\u207b :\";\n   text2= \"N has 5 valence e\u207b :\";\n   text3= \"There is 1 foreign e\u207b :\";\n   text4= \"\";\n   text5= \"\";\n  trmessage = \"CN\u207b \u2014 Cyanide ion | C: 4 valence e\u207b, N: 5 valence e\u207b + 1 extra from 1- charge | Triple bond, 1 lone pair on each atom | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"C needs 4 more electrons; N needs 3 more. There is 1 extra electron from the 1- charge. What bond type forms between C and N?\";\n   hintlevel2 = \"Place 3 shared pairs between C and N (triple bond). C keeps 1 lone pair; N keeps 1 lone pair. The extra electron from the charge goes on C.\";\n   correctexplanation = \"CN\u207b has a triple bond (like N\u2082). C has 1 lone pair; N has 1 lone pair. The extra electron is on the carbon atom.\";\n   mcqquestion = \"Conceptual check: What type of bond is in CN\u207b?\\nType: single, double, or triple\";\n   mcqanswer = \"triple\";\n   mcqexplanation = \"CN\u207b is isoelectronic with N\u2082 \u2014 it has a triple bond. C and N each have 1 lone pair. The 1- charge extra electron is on C.\";\n\n   \n  whythismatters = 'Cyanide (CN-) binds to haemoglobin over 200 times more strongly than O2. That is why even tiny amounts are lethal.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = '1 lone pair on each atom; triple bond + symmetry give a linear shape.';\n  moleculepolarity = 'Ion (charged)';\n}\n"
        },
        {
          "Name": "option8",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option8 () { //water\nquestion=8;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n  nanimals=6;\n  nanimals2=1;\n   nanimalsshow3=true;\n   nanimalsshow4=false;\n   nanimalsshow5=false;\n   nanimals3=1;\n   symbol=\"O\";\n   symbol2=\"H\";\n   symbol3=\"H\";\n   textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n    text1= \"O has \"+nanimals+\" valence e\u207b :\";\n   text2= \"H has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"H has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"\";\n   text5= \"\";\n trmessage = \"H\u2082O \u2014 Water | O: 6 valence e\u207b (needs 2 more), H: 1 valence e\u207b | 2 O-H bonds, 2 lone pairs on O | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"O needs 2 more electrons and bonds with 2 H atoms. How many bonds does O form, and how many lone pairs remain on O?\";\n   hintlevel2 = \"Form 1 O-H bond on each side of O. O keeps 4 electrons as 2 lone pairs. Each H has no lone pairs.\";\n   correctexplanation = \"H\u2082O has 2 bonding pairs (O-H bonds) and 2 lone pairs on O. The lone pairs cause the bent shape (104.5\u00b0).\";\n   mcqquestion = \"Conceptual check: How many lone pairs does O have in H\u2082O?\\nType 1, 2, or 3\";\n   mcqanswer = \"2\";\n   mcqexplanation = \"O in H\u2082O has 2 lone pairs. These 2 lone pairs cause the bent shape and make water a polar molecule.\";\n\n   \n  whythismatters = 'Water\\'s bent, polar shape creates hydrogen bonds - giving it a high boiling point, surface tension, and making it the solvent of life.';\n  moleculeshape = 'Bent';\n  bondangle = '104.5 degrees';\n  shapedescription = '2 lone pairs on O repel more strongly than bonding pairs, compressing the bond angle to 104.5 degrees and causing the bent shape.';\n  moleculepolarity = 'Polar';\n}\n"
        },
        {
          "Name": "option9",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option9 () {\nquestion=9;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n  nanimals=4;\n  nanimals2=6;\n  nanimalsshow3=true;\n  nanimalsshow4=false;\n  nanimalsshow5=false;\n   nanimals3=6;\n   symbol=\"C\";\n   symbol2=\"O\";\n   symbol3=\"O\";\n   textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n    text1= \"C has \"+nanimals+\" valence e\u207b :\";\n   text2= \"O has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"O has \"+nanimals3+\" valence e\u207b :\";\n   text4=\"\";\n   text5= \"\";\n  trmessage = \"CO\u2082 \u2014 Carbon dioxide | C: 4 valence e\u207b, O: 6 valence e\u207b | 2 C=O double bonds, 2 lone pairs on each O | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"C needs 4 more electrons; each O needs 2 more. C forms 2 bonds with the 2 O atoms. What type of bond with each O?\";\n   hintlevel2 = \"C forms a double bond (2 shared pairs) with each O. Each O keeps 4 electrons as 2 lone pairs. C has no lone pairs.\";\n   correctexplanation = \"CO\u2082 has 2 double bonds (C=O on each side). Each O has 2 lone pairs. CO\u2082 is linear and non-polar.\";\n   mcqquestion = \"Conceptual check: How many double bonds are in CO\u2082?\\nType 1, 2, or 3\";\n   mcqanswer = \"2\";\n   mcqexplanation = \"CO\u2082 has 2 double bonds (one C=O on each side of C). This linear arrangement makes CO\u2082 non-polar overall.\";\n\n   \n  whythismatters = 'CO2\\'s linear, non-polar shape allows it to accumulate in the atmosphere and absorb infrared radiation, making it a key greenhouse gas driving climate change.';\n  moleculeshape = 'Linear';\n  bondangle = '180 degrees';\n  shapedescription = '2 C=O double bonds are symmetrical; their dipoles cancel so the molecule is linear and non-polar overall.';\n  moleculepolarity = 'Non-polar';\n}\n"
        },
        {
          "Name": "option10",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option10 () {\nquestion=10;\nfont1= \"normal bold 2vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n  nanimals=5;\n  nanimals2=6;\n  nanimalsshow3=true;\n  nanimalsshow4=true;\n  nanimalsshow5=false;\n  nanimals3=6;\n    nanimals4 =1;\n\n   symbol=\"N\";\n   symbol2=\"O\";\n   symbol3=\"O\";\n    textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     textobject4= [\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"];\n  text1= \"N has \"+nanimals+\" valence e\u207b :\";\n   text2= \"O has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"O has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"There is 1 foreign e\u207b :\";\n   text5= \"\";\n   trmessage = \"NO\u2082\u207b \u2014 Nitrite ion | N: 5 valence e\u207b, O: 6 valence e\u207b + 1 extra from 1- charge | 1 N-O and 1 N=O bond | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"NO\u2082\u207b has 1 extra electron from its 1- charge on one of the O atoms. N bonds to both O atoms with different bond types.\";\n   hintlevel2 = \"N forms 1 single bond (N-O) and 1 double bond (N=O) with the 2 O atoms. N has 1 lone pair. The extra electron (1- charge) goes on the singly-bonded O.\";\n   correctexplanation = \"NO\u2082\u207b has 1 single bond and 1 double bond. N has 1 lone pair. In reality, resonance makes both bonds equivalent (bond order 1.5).\";\n   mcqquestion = \"Conceptual check: How many lone pairs does N have in NO\u2082\u207b?\\nType 1, 2, or 3\";\n   mcqanswer = \"1\";\n   mcqexplanation = \"N in NO\u2082\u207b has 1 lone pair. In reality, both N-O bonds are equivalent due to resonance (bond order 1.5).\";\n\n\n  whythismatters = 'Nitrite ions (NO2-) are used as food preservatives (E250) in cured meats like bacon. They prevent deadly botulism bacteria from growing.';\n  moleculeshape = 'Bent (~115 degrees)';\n  bondangle = '~115 degrees';\n  shapedescription = '1 lone pair on N + 2 bonds gives a bent shape (less compressed than H2O).';\n  moleculepolarity = 'Ion (charged)';\n}\n"
        },
        {
          "Name": "option11",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option11 () { //ammonia\nquestion=11;\nfont1= \"normal bold 1vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n  nanimals=5;\n  nanimals2=1;\n   nanimals3=1;\n   nanimals4=1;\n   nanimalsshow3=true;\n   nanimalsshow4=true;\n  symbol=\"N\";\n   symbol2=\"H\";\n   symbol3=\"H\";\n   symbol4=\"H\";\n   textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     textobject4= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     text1= \"N has \"+nanimals+\" valence e\u207b :\";\n   text2= \"H has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"H has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"H has \"+nanimals4+\" valence e\u207b :\";\n   text5= \"\";\n    trmessage = \"NH\u2083 \u2014 Ammonia | N: 5 valence e\u207b, H: 1 valence e\u207b | 3 N-H bonds, 1 lone pair on N | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"N needs 3 more electrons and bonds with 3 H atoms. How many bonds does N form, and how many electrons are left over as lone pairs?\";\n   hintlevel2 = \"N forms 1 bond with each of the 3 H atoms (3 bonds total). N keeps 2 electrons as 1 lone pair. Each H has no lone pairs.\";\n   correctexplanation = \"NH\u2083 has 3 bonding pairs (N-H bonds) and 1 lone pair on N. The lone pair causes the trigonal pyramidal shape.\";\n   mcqquestion = \"Conceptual check: How many lone pairs does N have in NH\u2083?\\nType 1, 2, or 3\";\n   mcqanswer = \"1\";\n   mcqexplanation = \"N in NH\u2083 has 1 lone pair. This lone pair pushes the 3 H atoms down, creating a trigonal pyramidal shape.\";\n\n// nanimals4 =6;\n// nanimals5 =2;\n\n  whythismatters = 'Ammonia feeds half the world\\'s population. The Haber process makes NH3 from N2 and H2, enabling nitrogen fertiliser production at global scale.';\n  moleculeshape = 'Trigonal pyramidal';\n  bondangle = '107 degrees';\n  shapedescription = '1 lone pair on N pushes the 3 H atoms downward, creating a pyramidal shape rather than a flat triangular one.';\n  moleculepolarity = 'Polar';\n}\n"
        },
        {
          "Name": "option12",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option12 () {\nquestion=12;\nfont1= \"normal bold 1vw \";\nfont2= \"normal bold 2vw \";\n textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\nlayelectrons (); // position of this make the electron at correct position\n  nanimals=4;\n  nanimals2=1;\n   nanimals3=1;\n   nanimals4=1;\n   nanimals5=1;\n   nanimalsshow3=true;\n   nanimalsshow4=true;\n   nanimalsshow5=true;\n     textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     textobject4= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n       textobject5= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     \n  symbol=\"C\";\n   symbol2=\"H\";\n   symbol3=\"H\";\n   symbol4=\"H\";\n   symbol5=\"H\";\n     text1= \"C has \"+nanimals+\" valence e\u207b :\";\n   text2= \"H has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"H has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"H has \"+nanimals4+\" valence e\u207b :\";\n   text5= \"H has \"+nanimals5+\" valence e\u207b :\";\n   trmessage = \"CH\u2084 \u2014 Methane | C: 4 valence e\u207b, H: 1 valence e\u207b | 4 C-H bonds, no lone pairs on C | Drag and drop electrons into the diagram.\";\n   attemptq = 0;\n   hintlevel1 = \"C needs 4 more electrons and bonds with 4 H atoms. How many bonds does C form? Does it have any lone pairs?\";\n   hintlevel2 = \"C forms 1 bond with each of the 4 H atoms (4 bonds total). C has no lone pairs \u2014 all 4 valence electrons are used in bonds.\";\n   correctexplanation = \"CH\u2084 has 4 bonding pairs (C-H bonds) and no lone pairs on C. This gives a tetrahedral shape with bond angles of 109.5\u00b0.\";\n   mcqquestion = \"Conceptual check: What bond angle would you expect in CH\u2084?\\nType 90, 109.5, or 120\";\n   mcqanswer = \"109.5\";\n   mcqexplanation = \"CH\u2084 has a tetrahedral shape with bond angles of 109.5\u00b0. 4 bonding pairs with no lone pairs give perfect tetrahedral geometry.\";\n\n// nanimals4 =6;\n// nanimals5 =2;\n\n  whythismatters = 'Methane is natural gas. Its non-polar tetrahedral structure makes it a stable, energy-dense fuel. It is also 25 times more potent as a greenhouse gas than CO2.';\n  moleculeshape = 'Tetrahedral';\n  bondangle = '109.5 degrees';\n  shapedescription = '4 identical bonding pairs and no lone pairs give perfect tetrahedral geometry with equal 109.5 degree angles.';\n  moleculepolarity = 'Non-polar';\n}\n"
        },
        {
          "Name": "option13 2",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option13 () {\nquestion=13;\nfont1= \"normal bold 1vw \";\nfont2= \"normal bold 2vw \";\nlayelectrons (); // position of this make the electron at correct position\n  nanimals=4;\n  nanimals2=6;\n   nanimals3=6;\n   nanimals4=6;\n   nanimals5 =2;\n   nanimalsshow3=true;\n   nanimalsshow4=true;\n   nanimalsshow5=true;\n    textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"]; // need to toggle back to X after q14\n    textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     textobject4= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n       textobject5= [\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"];\n  symbol=\"C\";\n   symbol2=\"O\";\n  symbol3=\"O\";\n   symbol4=\"O\";\n     text1= \"C has \"+nanimals+\" valence e\u207b :\";\n   text2= \"O has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"O has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"O has \"+nanimals4+\" valence e\u207b :\";\n   text5= \"There are \"+nanimals5+\" foreign e\u207b :\";\n  trmessage = \"CO\u2083\u00b2\u207b \u2014 Carbonate ion | C: 4 valence e\u207b, O: 6 valence e\u207b + 2 extra from 2- charge | C bonds to 3 O atoms | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"CO\u2083\u00b2\u207b has 2 extra electrons from its 2- charge. C bonds to all 3 O atoms \u2014 1 double bond and 2 single bonds.\";\n   hintlevel2 = \"C forms 1 double bond (C=O) and 2 single bonds (C-O). The 2 extra electrons from the 2- charge are on the singly-bonded O atoms.\";\n   correctexplanation = \"CO\u2083\u00b2\u207b has 1 double bond and 2 single bonds. The 2- charge is on the O atoms. Resonance makes all 3 bonds equivalent.\";\n   mcqquestion = \"Conceptual check: How many bonds does C form in CO\u2083\u00b2\u207b?\\nType 2, 3, or 4\";\n   mcqanswer = \"3\";\n   mcqexplanation = \"C forms 3 bonds in CO\u2083\u00b2\u207b \u2014 one to each O atom. The molecule has trigonal planar geometry with 120\u00b0 bond angles.\";\n\n \n\n  whythismatters = 'Carbonate (CO3 2-) is in limestone, chalk, and marble. In antacid tablets it neutralises excess stomach acid: CO3 2- + 2H+ gives H2O + CO2.';\n  moleculeshape = 'Trigonal planar';\n  bondangle = '120 degrees';\n  shapedescription = '3 equivalent bonds due to resonance, with no lone pairs on C, giving a flat structure with 120 degree angles.';\n  moleculepolarity = 'Ion (charged)';\n}\n"
        },
        {
          "Name": "option14",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option14 () {\nquestion=14;\nfont1= \"normal bold 1vw \"; //effectively hidden as there is a new object drawing now\nfont2= \"normal bold 1vw \";\nlayelectrons (); // position of this make the electron at correct position\n  //hydrogen peroxide 1L=O, 1H=O, 3R=H , 4L=H\n  //O 6\n  // H 1\n  nanimals=6;\n  nanimals2=6;\n   nanimals3=1;\n   nanimals4=1;\n   //nanimals5 =2;\n   nanimalsshow3=true;\n   nanimalsshow4=true;\n   nanimalsshow5=false;\n   textobject2= [\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\",\"\ud83d\udd35\"];\n    textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     textobject4= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n      // textobject5= [\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"];\n  symbol=\"O\";\n   symbol2=\"O\";\n  symbol3=\"H\";\n   symbol4=\"H\";\n     text1= \"O has \"+nanimals+\" valence e\u207b :\";\n   text2= \"O has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"H has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"H has \"+nanimals4+\" valence e\u207b :\";\n   text5= \"\";\n  trmessage = \"H\u2082O\u2082 \u2014 Hydrogen peroxide | O: 6 valence e\u207b, H: 1 valence e\u207b | 2 O-H bonds + 1 O-O bond, 2 lone pairs on each O | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"Each O bonds to 1 H AND to the other O atom. How many bonds does each O form in total?\";\n   hintlevel2 = \"Each O forms 2 bonds (1 O-H bond and 1 O-O bond). Each O keeps 4 electrons as 2 lone pairs. Each H has no lone pairs.\";\n   correctexplanation = \"H\u2082O\u2082 has 2 O-H bonds and 1 O-O bond. Each O has 2 lone pairs. It is the simplest peroxide compound.\";\n   mcqquestion = \"Conceptual check: How many O-O bonds are in H\u2082O\u2082?\\nType 1, 2, or 3\";\n   mcqanswer = \"1\";\n   mcqexplanation = \"H\u2082O\u2082 has 1 O-O single bond. This bond is relatively weak, making H\u2082O\u2082 a reactive oxidising agent.\";\n\n \n\n  whythismatters = 'Hydrogen peroxide bleaches hair and disinfects wounds. Its weak O-O single bond makes it a powerful oxidising agent that decomposes to water plus O2.';\n  moleculeshape = 'Non-linear chain';\n  bondangle = '~100 degrees';\n  shapedescription = '2 lone pairs on each O plus the O-O single bond create a skewed, non-linear chain structure.';\n  moleculepolarity = 'Polar';\n}\n"
        },
        {
          "Name": "option15",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function option15 () {\nquestion=15;\nfont1= \"normal bold 1vw \"; //effectively hidden as there is a new object drawing now\nfont2= \"normal bold 2vw \";\nlayelectrons (); // position of this make the electron at correct position\n  //\"sulfate ions, SO\u2083\u00b2\u207b\"\n  //S 6\n  // O 6\n  nanimals=6;\n  nanimals2=6;\n   nanimals3=6;\n   nanimals4=6;\n   nanimals5 =2;\n   nanimalsshow3=true;\n   nanimalsshow4=true;\n   nanimalsshow5=true;\n   textobject2= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n    textobject3= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n     textobject4= [\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\",\"X\"];\n       textobject5= [\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\"];\n  symbol=\"S\";\n   symbol2=\"O\";\n  symbol3=\"O\";\n   symbol4=\"O\";\n     text1= \"S has \"+nanimals+\" valence e\u207b :\";\n   text2= \"O has \"+nanimals2+\" valence e\u207b :\";\n   text3= \"O has \"+nanimals3+\" valence e\u207b :\";\n   text4= \"O has \"+nanimals4+\" valence e\u207b :\";\n   text5= \"There are \"+nanimals5+\" foreign e- :\";\n  trmessage = \"SO\u2083\u00b2\u207b \u2014 Sulfite ion | S: 6 valence e\u207b, O: 6 valence e\u207b + 2 extra from 2- charge | S bonds to 3 O atoms | Drag and drop electrons.\";\n   attemptq = 0;\n   hintlevel1 = \"SO\u2083\u00b2\u207b has 2 extra electrons from its 2- charge. S bonds to all 3 O atoms. Consider how many lone pairs are on each atom.\";\n   hintlevel2 = \"S forms bonds to all 3 O atoms. The 2- charge gives extra electrons to the O atoms as lone pairs. S also has 1 lone pair.\";\n   correctexplanation = \"SO\u2083\u00b2\u207b has S bonded to 3 O atoms. The 2- charge is distributed among the O atoms. S has 1 lone pair.\";\n   mcqquestion = \"Conceptual check: How many extra electrons does the 2- charge add to SO\u2083\u00b2\u207b?\\nType 1, 2, or 3\";\n   mcqanswer = \"2\";\n   mcqexplanation = \"The 2- charge means 2 extra electrons are added. These are distributed on the O atoms as extra lone pairs.\";\n\n \n\n  whythismatters = 'Sulfite (SO3 2-) is food preservative E221. It keeps wine and dried fruit from browning by scavenging oxygen before it can oxidise the food.';\n  moleculeshape = 'Trigonal pyramidal';\n  bondangle = '~106 degrees';\n  shapedescription = '1 lone pair on S + 3 S-O bonds gives a pyramidal shape, similar to NH3 but with S as the central atom.';\n  moleculepolarity = 'Ion (charged)';\n}\n"
        },
        {
          "Name": "layelectrons",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function layelectrons () {\n//layelectrons\nif (question<11){\n tmpstart = 2.5;\n tmpend = 1.5;\n}\nelse if (question==11){\n   tmpstart = 2.5;\n tmpend = 1.5;\n  }\nelse if (question>=12&&question<=13){\n   tmpstart = 3.6;\n tmpend = 2.6;\n  }\n  else if (question==14){ // hydrogen peroxide\n    tmpstart = 2.5;\n tmpend = 1.5;\n    }\n  else if (question==15){\n   tmpstart = 3.6;\n tmpend = 2.6;\n  }\n  \n yspace = linspace(tmpstart,tmpend,5); // 5 is the maximum number of electron rows\n\nxanimals = linspace(0,3,7);// easy way to space them\nxanimalss = linspace(0,3,7);// easy way to space them\n//yanimals = linspace(2.5,2.5,7); //hard code position\nyanimals = linspace(yspace[0],yspace[0],7);\n//yanimalss = linspace(2.5,2.5,7); //hard code stored position\nyanimalss =linspace(yspace[0],yspace[0],7);\n\nxanimals2 = linspace(0,3,7);// easy way to space them\nxanimalss2 = linspace(0,3,7);// easy way to space them\n//yanimals2 = linspace(2,2,7); //hard code position\nyanimals2 = linspace(yspace[1],yspace[1],7); \n//yanimalss2 = linspace(2,2,7); //hard code stored position\nyanimalss2 = linspace(yspace[1],yspace[1],7); \n\n\nxanimals3 = linspace(0,3,7);// easy way to space them\nxanimalss3 = linspace(0,3,7);// easy way to space them\n//yanimals3 = linspace(1.5,1.5,7); //hard code position\nyanimals3 = linspace(yspace[2],yspace[2],7);\n//yanimalss3 = linspace(1.5,1.5,7); //hard code stored position\nyanimalss3 = linspace(yspace[2],yspace[2],7);\n\n\nxanimals4 = linspace(0,3,7);// easy way to space them\nxanimalss4 = linspace(0,3,7);// easy way to space them\n//yanimals4 = linspace(1,1,7); //hard code position\nyanimals4 = linspace(yspace[3],yspace[3],7);\n//yanimalss4 = linspace(1,1,7); //hard code stored position\nyanimalss4 = linspace(yspace[3],yspace[3],7);\n\nxanimals5 = linspace(0,3,7);// easy way to space them\nxanimalss5 = linspace(0,3,7);// easy way to space them\n//yanimals4 = linspace(1,1,7); //hard code position\nyanimals5 = linspace(yspace[4],yspace[4],7);\n//yanimalss4 = linspace(1,1,7); //hard code stored position\nyanimalss5 = linspace(yspace[4],yspace[4],7);\n\n}\n"
        },
        {
          "Name": "return",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function returnelectron1 () {\n\nfor (var i=0; i<=8  ; i++) { // hard copy max 8, assume nanimals may create case where nanimals is smaller than nanimals2345\n  enabledposition[i]=\"ENABLED_ANY\"; // this must be done to ease debugging as nanimals3=1\nenabledposition2[i]=\"ENABLED_ANY\";\nenabledposition3[i]=\"ENABLED_ANY\";\nenabledposition4[i]=\"ENABLED_ANY\";\n enabledposition5[i]=\"ENABLED_ANY\";\n\nstop[i]=0;\nstop2[i]=0;\n\n}\n\n\n//\nfor (var i=0; i<n  ; i++) { // reset detection of occupied atoms space\n  occupied[i]=0; // short cut do reset all here\n  occupied2[i]=0; // short cut do reset all here\n  occupied3[i]=0; // short cut do reset all here\n  occupied4[i]=0; // short cut do reset all here\n  occupied5[i]=0; // short cut do reset all here\n}\n\n//reset to zero for water case debug\nsumsharede=0;\nsumsharede2=0;\nsumsharede3=0;\nsumsharede4=0;\nsumsharede5=0;\nsumsharede6=0;\nsumsharede7=0;\nsumsharede8=0;\nsumpersonale=0;\nsumpersonale2=0;\nsumpersonale3=0;\nsumpersonale4=0;\n\n\n    }\n"
        },
        {
          "Name": "linespace",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "//https://gist.github.com/joates/6584908\n// a is start\n// b is stop\n// n is number of them to space out in\nfunction linspace(a,b,n) {\n    if(typeof n === \"undefined\") n = Math.max(Math.round(b-a)+1,1);\n    if(n<2) { return n===1?[a]:[]; }\n    var i,ret = Array(n);\n    n--;\n    for(i=n;i>=0;i--) { ret[i] = (i*b+(n-i)*a)/n; }\n    return ret;\n}"
        },
        {
          "Name": "instantchecking",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function instantchecking () {\n\n//master checking\n// electron 1 set on atom1 assume no electron set 1 can be placed on 2,3,4,5 atoms set\nfor (var i=0; i<=nanimals ; i++) {\n   for (var j=0; j<n ; j++) {\n   if((Math.abs(xanimals[i]-xcell[j])<0.1)&&(Math.abs(yanimals[i]-ycell[j])<0.1)){ \n   occupied[j]=Math.max(1,occupied[j]); \n   }\n   else {\n    occupied[j]=Math.max(0,occupied[j]); \n     }\n                           }\n                           }\n                                 \n //2  \n // electron 2 set on atom2 assume no electron set 2 can be placed on 1,3,4,5 atoms set\nfor (var i=0; i<=nanimals2 ; i++) {\n   for (var j=0; j<n2 ; j++) {\n   if((Math.abs(xanimals2[i]-xcell2[j])<0.1)&&(Math.abs(yanimals2[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]);\n     }\n                           }\n                                  }\n\n\n//3\n// electron 3 set on atom3\nfor (var i=0; i<=nanimals3 ; i++) {\n   for (var j=0; j<n3 ; j++) {\n   if((Math.abs(xanimals3[i]-xcell3[j])<0.1)&&(Math.abs(yanimals3[i]-ycell3[j])<0.1)){ \n   occupied3[j]=Math.max(1,occupied3[j]); \n   }\n   else {\n    occupied3[j]=Math.max(0,occupied3[j]); \n     }\n                           }\n                                  }\n  \n  if (question==6||question==7) { //q6 and 7\n// electron 3 set on atom1 need for question 6 for case foreign electron on atom1 position\n// q6 count f electron on  atom1 all positions\nfor (var i=0; i<=nanimals3 ; i++) {\n   for (var j=0; j<n3 ; j++) {\n   if((Math.abs(xanimals3[i]-xcell[j])<0.1)&&(Math.abs(yanimals3[i]-ycell[j])<0.1)){ \n   occupied[j]=Math.max(1,occupied[j]); \n   }\n   else {\n    occupied[j]=Math.max(0,occupied[j]); \n     }\n                           }\n                                  }\n\n// forgien electron 1 set on atom2\n// q6 count f electron on  atom2 selected 0 to 19 and 29 to 31, omit 21 to 27 to aviod double count of sumsharede2\n for (var i=0; i<=nanimals3 ; i++) {\n   //copy start\n   for (var j=0; j<=19 ; j++) {  \n   if((Math.abs(xanimals3[i]-xcell2[j])<0.1)&&(Math.abs(yanimals3[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]); \n     }\n                           }\n                           //copy end\n                           \n    //copy start2\n   for (var j=29; j<=31 ; j++) {  \n   if((Math.abs(xanimals3[i]-xcell2[j])<0.1)&&(Math.abs(yanimals3[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]); \n     }\n                           }\n                           //copy end    2                   \n                           \n                           \n                                  }   \n                                  // start\n                                  \n                                  \n                                  }// q 6 and 7\n                                  \n\n//4                       \n// electron 4 set on atom4\nfor (var i=0; i<=nanimals4 ; i++) {\n   for (var j=0; j<n4 ; j++) {\n   if((Math.abs(xanimals4[i]-xcell4[j])<0.1)&&(Math.abs(yanimals4[i]-ycell4[j])<0.1)){ \n   occupied4[j]=Math.max(1,occupied4[j]); \n   }\n   else {\n    occupied4[j]=Math.max(0,occupied4[j]); \n     }\n                           }\n                                  }\n      \n       if (question==10) { //q10\n                                  \n                                  // f electron 4 set on atom1\n// f count everything on atom1\nfor (var i=0; i<=nanimals4 ; i++) {\n   for (var j=0; j<n4 ; j++) {\n   if((Math.abs(xanimals4[i]-xcell[j])<0.1)&&(Math.abs(yanimals4[i]-ycell[j])<0.1)){ \n   occupied[j]=Math.max(1,occupied[j]); \n   }\n   else {\n    occupied[j]=Math.max(0,occupied[j]); \n     }\n                           }\n                                  }\n                                  \n                                  \n // f electron 4 set on atom2\n // avoid counting b21 to b27\nfor (var i=0; i<=nanimals4 ; i++) {\n  //start \n   for (var j=0; j<=19 ; j++) {\n   if((Math.abs(xanimals4[i]-xcell2[j])<0.1)&&(Math.abs(yanimals4[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]); \n     }\n                           }//end\n                           \n     //start 2\n   for (var j=29; j<=31 ; j++) {\n   if((Math.abs(xanimals4[i]-xcell2[j])<0.1)&&(Math.abs(yanimals4[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]); \n     }\n                           }//end   2                   \n                           \n                           \n                           \n                           \n                                  }   //atom2 \n                                  \n                                  \n                                  \n                                  \n                                  \n                                  \n                                  \n                                  \n  //  f electron 4 set on atom3\n  \nfor (var i=0; i<=nanimals4 ; i++) {\n  //start //avoid counting c5 to c11\n   for (var j=0; j<=3 ; j++) {\n   if((Math.abs(xanimals4[i]-xcell3[j])<0.1)&&(Math.abs(yanimals4[i]-ycell3[j])<0.1)){ \n   occupied3[j]=Math.max(1,occupied3[j]); \n   }\n   else {\n    occupied3[j]=Math.max(0,occupied3[j]); \n     }\n                           }//end\n     //start2\n   for (var j=13; j<=31 ; j++) {\n   if((Math.abs(xanimals4[i]-xcell3[j])<0.1)&&(Math.abs(yanimals4[i]-ycell3[j])<0.1)){ \n   occupied3[j]=Math.max(1,occupied3[j]); \n   }\n   else {\n    occupied3[j]=Math.max(0,occupied3[j]); \n     }\n                           }//end2                      \n                           \n                           \n                           \n                                  }     \n                                  } //q 10\n                                  \n\n//5                       \n// electron 5 set on atom5\n// occupied5 if for CH4\nfor (var i=0; i<=nanimals5 ; i++) {\n   for (var j=0; j<n5 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell5[j])<0.1)&&(Math.abs(yanimals5[i]-ycell5[j])<0.1)){ \n   occupied5[j]=Math.max(1,occupied5[j]); \n   }\n   else {\n    occupied5[j]=Math.max(0,occupied5[j]); \n     }\n                           }\n                                  }\n\n\n if (question==13||question==15) { //q13\n// electron 5 set on atom1\n// count all\nfor (var i=0; i<=nanimals5 ; i++) {\n   for (var j=0; j<n5 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell[j])<0.1)&&(Math.abs(yanimals5[i]-ycell[j])<0.1)){ \n   occupied[j]=Math.max(1,occupied[j]); \n   }\n   else {\n    occupied[j]=Math.max(0,occupied[j]); \n     }\n                           }\n                                  }\n//include f on atom1\nfor (var i=0; i<=nanimals5 ; i++) {\n   for (var j=0; j<n ; j++) {\n   if((Math.abs(xanimals5[i]-xcell[j])<0.1)&&(Math.abs(yanimals5[i]-ycell[j])<0.1)){ \n   occupied[j]=Math.max(1,occupied[j]); \n   }\n   else {\n    occupied[j]=Math.max(0,occupied[j]); \n     }\n                           }\n                                  }\n\n\n\n\n// f electron 5 set on atom2\n\nfor (var i=0; i<=nanimals5 ; i++) {\n  //start // dont count b24 to b27\n   for (var j=0; j<=22 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell2[j])<0.1)&&(Math.abs(yanimals5[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]); \n     }\n                           }//end\n   //start2 redundant actually since no 31\n   for (var j=31; j<=31 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell2[j])<0.1)&&(Math.abs(yanimals5[i]-ycell2[j])<0.1)){ \n   occupied2[j]=Math.max(1,occupied2[j]); \n   }\n   else {\n    occupied2[j]=Math.max(0,occupied2[j]); \n     }\n                           }//end 2                       \n                           \n                           \n                                  }\n\n// f electron 5 set on atom3\n\nfor (var i=0; i<=nanimals5 ; i++) {\n   //dont count c2 to c5\n   //start\n   for (var j=0; j<=0 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell3[j])<0.1)&&(Math.abs(yanimals5[i]-ycell3[j])<0.1)){ \n   occupied3[j]=Math.max(1,occupied3[j]); \n   }\n   else {\n    occupied3[j]=Math.max(0,occupied3[j]); \n     }\n                           } //End\n   //start2\n   for (var j=10; j<=31 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell3[j])<0.1)&&(Math.abs(yanimals5[i]-ycell3[j])<0.1)){ \n   occupied3[j]=Math.max(1,occupied3[j]); \n   }\n   else {\n    occupied3[j]=Math.max(0,occupied3[j]); \n     }\n                           } //End 2                       \n                           \n                           \n                           \n                           \n                                  }\n\n// f electron 5 set on atom4\n\nfor (var i=0; i<=nanimals5 ; i++) {\n  // dont count d13 to d16\n  //start\n   for (var j=0; j<=11 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell4[j])<0.1)&&(Math.abs(yanimals5[i]-ycell4[j])<0.1)){ \n   occupied4[j]=Math.max(1,occupied4[j]); \n   }\n   else {\n    occupied4[j]=Math.max(0,occupied4[j]); \n     }\n                           }//end\n                           \n                           //start2\n   for (var j=21; j<=31 ; j++) {\n   if((Math.abs(xanimals5[i]-xcell4[j])<0.1)&&(Math.abs(yanimals5[i]-ycell4[j])<0.1)){ \n   occupied4[j]=Math.max(1,occupied4[j]); \n   }\n   else {\n    occupied4[j]=Math.max(0,occupied4[j]); \n     }\n                           }//end2\n                           \n                           \n                           \n                                  }\n                                  } //q13\n\n\n\n// sync sumsharede and sumpersonale\n\nif (question<=5){\n  check2atoms ();\n  }\n \n  if (question==6){\n  check2atomsOH ();\n  }\n  if (question==7){\n  check2atomsOH ();\n  }\n  // missing 7\nelse if (question==8){\n  check3atoms ();\n  }\n  else if (question==9||question==10){\n    check3atomsq9 ();\n    }\nelse if (question==11){ //ammonia\n    check3atomsq11 ();\n    }\n    else if (question==12){\n    check3atomsq12 ();\n    }\n    else if (question==13){\n    check3atomsq13 ();\n    }\n    else if (question==14){\n    check3atomsq14 ();\n    }\n    else if (question==15){ //yih check SO3-2\n    check3atomsq13 ();\n    }\n\n\n\n\n\n\n} //function end\n"
        },
        {
          "Name": "check2atoms",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check2atoms () {\nsumsharede=0; //initialize to zero\n  for (var i=5; i<=11 ; i++) {\n  sumsharede = sumsharede+occupied[i]; // atom1 shared electrons count\n}\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=21; i<=27 ; i++) {\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2 shared electrons count\n}\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=0; i<=3 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=12; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n\n\n\n\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=19 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\nfor (var i=29; i<=31 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n\n\n}\n"
        },
        {
          "Name": "check2atomsOH",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check2atomsOH () { // appears to be same as check2atoms ()\nsumsharede=0; //initialize to zero\n  for (var i=5; i<=11 ; i++) {\n  sumsharede = sumsharede+occupied[i]; // atom1 shared electrons count\n}\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=21; i<=27 ; i++) {\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2 shared electrons count\n}\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=0; i<=3 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=12; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n\n\n\n\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=19 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\nfor (var i=29; i<=31 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n\n\n} //function\n"
        },
        {
          "Name": "check3atoms",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check3atoms () { // for water q8\nsumsharede=0; //initialize to zero\n  for (var i=10; i<=14 ; i++) { //atom1 side\n  sumsharede = sumsharede+occupied[i]; // atom1-atom2 shared electrons count\n}\n\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=25; i<=n2-1 ; i++) { //atom2 side\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2-atom1 shared electrons count\n}\nsumsharede3=0; //initialize to zero\n  for (var i=18; i<=22 ; i++) { //atom1 side\n  sumsharede3 = sumsharede3+occupied[i]; // atom1-atom3 shared electrons count\n}\nsumsharede4=0; //initialize to zero\n  for (var i=1; i<=7 ; i++) { //atom1 side\n  sumsharede4 = sumsharede4+occupied3[i]; // atom1-atom3 shared electrons count\n}\n\n\n\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=0; i<=8 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=24; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=1; i<=23 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n// check electronset 3 outside shared space\nfor (var i=9; i<n3 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\n\n\n}\n"
        },
        {
          "Name": "check3atomsq9",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check3atomsq9 () {\nsumsharede=0; //initialize to zero\n  for (var i=5; i<=11 ; i++) { //atom1 side\n  sumsharede = sumsharede+occupied[i]; // atom1-atom2 shared electrons count\n}\n\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=21; i<=27 ; i++) { //atom2 side\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2-atom1 shared electrons count\n}\nsumsharede3=0; //initialize to zero\n  for (var i=21; i<=27 ; i++) { //atom1 side\n  sumsharede3 = sumsharede3+occupied[i]; // atom1-atom3 shared electrons count\n}\nsumsharede4=0; //initialize to zero\n  for (var i=5; i<=11 ; i++) { //atom3 side\n  sumsharede4 = sumsharede4+occupied3[i]; // atom1-atom3 shared electrons count\n}\n\n\n\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=0; i<=3 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=14; i<=18 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=29; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=19 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n for (var i=29; i<=31 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n// check electronset 3 outside shared space\nsumpersonale3=0;\nfor (var i=0; i<=3 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\nfor (var i=13; i<=31 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\n\n\n}\n"
        },
        {
          "Name": "check3atomsq11",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check3atomsq11 () { // same as q12\nsumsharede=0; //initialize to zero\n  for (var i=7; i<=8 ; i++) { //atom1 side\n  sumsharede = sumsharede+occupied[i]; // atom1-atom2 shared electrons count\n}\n\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=21; i<=22 ; i++) { //atom2 side\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2-atom1 shared electrons count\n}\nsumsharede3=0; //initialize to zero\n  for (var i=23; i<=24 ; i++) { //atom1 side\n  sumsharede3 = sumsharede3+occupied[i]; // atom1-atom3 shared electrons count\n}\nsumsharede4=0; //initialize to zero\n  for (var i=4; i<=5 ; i++) { //atom3 side\n  sumsharede4 = sumsharede4+occupied3[i]; // atom1-atom3 shared electrons count\n}\nsumsharede5=0; //initialize to zero\n  for (var i=15; i<=16 ; i++) { //atom1 side\n  sumsharede5 = sumsharede5+occupied[i]; // atom1-atom4 shared electrons count\n}\nsumsharede6=0; //initialize to zero\n  for (var i=0; i<=3 ; i++) { //atom3 side Right\n  sumsharede6 = sumsharede6+occupied4[i]; // atom1-atom3 shared electrons count\n}\nfor (var i=29; i<=31 ; i++) { //atom3 side Left\n  sumsharede6 = sumsharede6+occupied4[i]; // atom1-atom3 shared electrons count\n}\n\n\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=0; i<=5 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=11; i<=13 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=19; i<=21 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=27; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=18 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n for (var i=30; i<=31 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n// check electronset 3 outside shared space\nsumpersonale3=0;\nfor (var i=0; i<=2 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\nfor (var i=14; i<=31 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\n\n// check electronset 4 outside shared space\nsumpersonale4=0;\nfor (var i=6; i<=26 ; i++) {\n  sumpersonale4 = sumpersonale4+occupied4[i]; //atom3 personal electrons\n}\n\n\n\n\n\n} //function\n\n"
        },
        {
          "Name": "check3atomsq12",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check3atomsq12 () { // methane CH4\nsumsharede=0; //initialize to zero\n  for (var i=7; i<=8 ; i++) { //atom1 side\n  sumsharede = sumsharede+occupied[i]; // atom1-atom2 shared electrons count\n}\n\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=21; i<=22 ; i++) { //atom2 side\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2-atom1 shared electrons count\n}\nsumsharede3=0; //initialize to zero\n  for (var i=23; i<=24 ; i++) { //atom1 side\n  sumsharede3 = sumsharede3+occupied[i]; // atom1-atom3 shared electrons count\n}\nsumsharede4=0; //initialize to zero\n  for (var i=4; i<=5 ; i++) { //atom3 side\n  sumsharede4 = sumsharede4+occupied3[i]; // atom1-atom3 shared electrons count\n}\nsumsharede5=0; //initialize to zero\n  for (var i=15; i<=16 ; i++) { //atom1 side\n  sumsharede5 = sumsharede5+occupied[i]; // atom1-atom4 shared electrons count\n}\nsumsharede6=0; //initialize to zero\n  for (var i=0; i<=1 ; i++) { //atom3 side Right\n  sumsharede6 = sumsharede6+occupied4[i]; // atom1-atom3 shared electrons count\n}\n//for (var i=29; i<=31 ; i++) { //atom3 side Left\n//  sumsharede6 = sumsharede6+occupied4[i]; // atom1-atom3 shared electrons count\n//}\nsumsharede7=0; //initialize to zero\n  for (var i=0; i<=1 ; i++) { //atom1 side Right\n  sumsharede7 = sumsharede7+occupied[i]; // atom1-atom5 shared electrons count\n}\n// for (var i=31; i<=31 ; i++) { //atom1 side Left\n // sumsharede7 = sumsharede7+occupied[i]; // atom1-atom5 shared electrons count\n//}\nsumsharede8=0; //initialize to zero\n  for (var i=12; i<=13 ; i++) { //atom1 side\n  sumsharede8 = sumsharede8+occupied5[i]; // atom1-atom4 shared electrons count\n}\n\n\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=4; i<=4 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=12; i<=12 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=20; i<=20 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=27; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=18 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n for (var i=30; i<=31 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n// check electronset 3 outside shared space\nsumpersonale3=0;\nfor (var i=0; i<=2 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\nfor (var i=14; i<=31 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\n\n// check electronset 4 outside shared space\nsumpersonale4=0;\nfor (var i=6; i<=26 ; i++) {\n  sumpersonale4 = sumpersonale4+occupied4[i]; //atom3 personal electrons\n}\n\n// check electronset 5 outside shared space\nsumpersonale5=0;\nfor (var i=0; i<=9 ; i++) { //Left\n  sumpersonale5 = sumpersonale5+occupied5[i]; //atom3 personal electrons\n}\nfor (var i=23; i<=31 ; i++) { //Right\n  sumpersonale5 = sumpersonale5+occupied5[i]; //atom3 personal electrons\n}\n\n\n\n} //function\n\n"
        },
        {
          "Name": "check3atomsq13 2",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check3atomsq13 () { // same as q12\nsumsharede=0; //initialize to zero\n  for (var i=8; i<=11 ; i++) { //atom1 side\n  sumsharede = sumsharede+occupied[i]; // atom1-atom2 shared electrons count\n}\n// f is need to be included in sumsharede\n\n\n\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=24; i<=27 ; i++) { //atom2 side\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2-atom1 shared electrons count\n}\nsumsharede3=0; //initialize to zero\n  for (var i=19; i<=22 ; i++) { //atom1 side\n  sumsharede3 = sumsharede3+occupied[i]; // atom1-atom3 shared electrons count\n}\nsumsharede4=0; //initialize to zero\n  for (var i=2; i<=5 ; i++) { //atom3 side\n  sumsharede4 = sumsharede4+occupied3[i]; // atom1-atom3 shared electrons count\n}\nsumsharede5=0; //initialize to zero\n  for (var i=0; i<=1 ; i++) { //atom1 side\n  sumsharede5 = sumsharede5+occupied[i]; // atom1-atom4 shared electrons count\n}\nfor (var i=30; i<=31 ; i++) { //atom1 side\n  sumsharede5 = sumsharede5+occupied[i]; // atom1-atom4 shared electrons count\n}\nsumsharede6=0; //initialize to zero\n  for (var i=13; i<=16 ; i++) { //atom3 side Right\n  sumsharede6 = sumsharede6+occupied4[i]; // atom1-atom3 shared electrons count\n}\n\n\n\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=5; i<=6 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=16; i<=16 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=26; i<=27 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=22 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n \n// check electronset 3 outside shared space\nsumpersonale3=0;\nfor (var i=0; i<=0 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\nfor (var i=10; i<=31 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\n\n// check electronset 4 outside shared space\nsumpersonale4=0;\nfor (var i=0; i<=11 ; i++) {\n  sumpersonale4 = sumpersonale4+occupied4[i]; //atom3 personal electrons\n}\nfor (var i=21; i<=31 ; i++) {\n  sumpersonale4 = sumpersonale4+occupied4[i]; //atom3 personal electrons\n}\n\n\n\n\n\n} //function\n\n"
        },
        {
          "Name": "check3atomsq14",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function check3atomsq14 () { //  q14 hrdrogen peroxide \nsumsharede=0; //initialize to zero\n  for (var i=4; i<=11 ; i++) { //atom1 side\n  sumsharede = sumsharede+occupied[i]; // atom1-atom2 shared electrons count\n}\n\n// check electronset 2 inside shared space\n  sumsharede2=0; //initialize to zero\n  for (var i=21; i<=27 ; i++) { //atom2 side\n  sumsharede2 = sumsharede2+occupied2[i]; //atom2-atom1 shared electrons count\n}\nsumsharede3=0; //initialize to zero\n  for (var i=21; i<=27 ; i++) { //atom1 side\n  sumsharede3 = sumsharede3+occupied[i]; // atom1-atom3 shared electrons count\n}\nsumsharede4=0; //initialize to zero\n  for (var i=4; i<=12 ; i++) { //atom3 side\n  sumsharede4 = sumsharede4+occupied3[i]; // atom1-atom3 shared electrons count\n}\nsumsharede5=0; //initialize to zero\n  for (var i=5; i<=11 ; i++) { //atom2 side\n  sumsharede5 = sumsharede5+occupied2[i]; // atom2-atom4 shared electrons count\n}\n\nsumsharede6=0; //initialize to zero\n  for (var i=20; i<=28 ; i++) { //atom3 side Right\n  sumsharede6 = sumsharede6+occupied4[i]; // atom1-atom3 shared electrons count\n}\n\n\n\n// check electronset 1 outside shared space\n  sumpersonale=0; //initialize to zero\n  for (var i=0; i<=3 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=13; i<=19 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\nfor (var i=29; i<=31 ; i++) {\n  sumpersonale = sumpersonale+occupied[i]; //atom1 personal electrons\n}\n\n// check electronset 2 outside shared space\n  sumpersonale2=0; //initialize to zero\n  for (var i=0; i<=3 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\nfor (var i=13; i<=19 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\nfor (var i=29; i<=31 ; i++) {\n  sumpersonale2 = sumpersonale2+occupied2[i]; //atom2 personal electrons\n}\n \n// check electronset 3 outside shared space\nsumpersonale3=0;\nfor (var i=0; i<=2 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\nfor (var i=14; i<=31 ; i++) {\n  sumpersonale3 = sumpersonale3+occupied3[i]; //atom3 personal electrons\n}\n\n// check electronset 4 outside shared space\nsumpersonale4=0;\nfor (var i=0; i<=18 ; i++) {\n  sumpersonale4 = sumpersonale4+occupied4[i]; //atom3 personal electrons\n}\nfor (var i=30; i<=31 ; i++) {\n  sumpersonale4 = sumpersonale4+occupied4[i]; //atom3 personal electrons\n}\n\n\n\n\n\n} //function\n\n"
        },
        {
          "Name": "instantanswer",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "// older function may be unused\nfunction instantanswer () {\n// for debugging instant answers\nif (question<=7){\ncheck2atoms ();\n}\nelse if (question==8){\n  check3atoms ();\n  }\n  else if (question==9||question==10){\n  check3atomsq9 ();\n  }\n  else if (question==11){\n  check3atomsq11 ();\n  }\n  else if (question==12){\n check3atomsq12 ();\n  }\n  else if (question==13){\n check3atomsq13 ();\n  }\n // add new stuff here \n  \n  \n  }\n"
        },
        {
          "Name": "indexchanging",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function indexchanging () {\nvar tmp  = Number(_view.comboBox.getSelectedOptionsIndexes());\nif (tmp<=9){\n  indexes=tmp+1;\n  }\nelse if (tmp==10){\n  indexes = \"\";\n  }\n  else if (tmp>=11){\n    indexes = tmp;\n    }\n    \n    }\n"
        },
        {
          "Name": "computeStars",
          "Active": "true",
          "Internal": "false",
          "Type": "LIBRARY_EDITOR",
          "Comment": "",
          "Code": "function computeStars() {\n  var q = question - 1;\n  if (q < 0 || q >= 15) return;\n  // Determine star rating based on wrong attempts before correct answer\n  var newStars = (attemptq === 0) ? 3 : (attemptq === 1) ? 2 : 1;\n  // Parse the CSV, upgrade if new rating is higher (never downgrade)\n  var parts = starsCSV.split(',');\n  while (parts.length < 15) parts.push('0');\n  var current = parseInt(parts[q]) || 0;\n  if (newStars > current) {\n    parts[q] = String(newStars);\n    starsCSV = parts.join(',');\n  }\n  // Streak: increment on first-attempt correct, reset otherwise\n  streakcount = (attemptq === 0) ? streakcount + 1 : 0;\n}"
        }
      ]
    },
    "elements": {
      "list": []
    }
  },
  "view": {
    "Tree": [
      {
        "Name": "singlePlotPanel",
        "Type": "Panel",
        "Expanded": "true",
        "Properties": [],
        "Children": [
          {
            "Name": "controlPanel",
            "Type": "Panel",
            "Expanded": "false",
            "Properties": [],
            "Children": [
              {
                "Name": "firstRowPanel",
                "Type": "Panel",
                "Expanded": "false",
                "Properties": [],
                "Children": [
                  {
                    "Name": "executionPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "question",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Question \"+indexes+\" :\""
                          },
                          {
                            "name": "Width",
                            "value": "\"15vw\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal 2vw \""
                          }
                        ]
                      },
                      {
                        "Name": "label",
                        "Type": "Label",
                        "Properties": []
                      },
                      {
                        "Name": "comboBox",
                        "Type": "ComboBox",
                        "Properties": [
                          {
                            "name": "Options",
                            "value": "[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"water, H\u2082O\",\"ammonia, NH\u2083\",\"carbon dioxide, CO\u2082\",\"methane, CH\u2084\",\"hydrogen peroxide, H\u2082O\u2082\",\"Polyatomic Ions (Advanced Level)\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]"
                          },
                          {
                            "name": "Background",
                            "value": "backgroundcolor"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"click reset to enable this comboBox\""
                          },
                          {
                            "name": "OnChange",
                            "value": "// to add comboBox that works and does not jam up the simulation when selected and simulation is running\n// options = [\"N\u2080 =100\",\"N\u2080 =4\",\"N\u2080 =9\",\"N\u2080 =16\",\"N\u2080 =25\",\"N\u2080 =36\",\"N\u2080 =49\",\"N\u2080 =64\",\"N\u2080 =81\",\"N\u2080 =121\",\"N\u2080 =144\",\"N\u2080 =169\",\"N\u2080 =225\",\"N\u2080 =289\",\"N\u2080 =324\",\"N\u2080 =361\",\"N\u2080 =400\",\"N\u2080 =1024\",\"N\u2080 =1600\",\"N\u2080 =2500\"]\n// OnChange\n//[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"\",\"water, H\u2082O\",\"carbon dioxide, CO\u2082\",\"nitrite ion, NO\u2082\u207b\",\"\",\"ammonia, NH\u2083\",\"hydrogen peroxide,H\u2082O\u2082\",\"\",\"methane, CH\u2084\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n\n//[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\nreturnelectron1 ();\n\nvar opts = _view.comboBox.getProperty(\"SelectedOptions\");  // array of options\n    var option = (opts.length > 0)? opts[0]:\"\"; // selected option \nif ( option==\"hydrogen molecule, H\u2082\"){\n   option1();\n   laycells ();\n  }\nelse if ( option==\"chlorine molecule, Cl\u2082\"){\n  option2();\n  laycells ();\n // textanswer=[1,2,3];\n  }\n  //\"mosquito 4 stages\"\n  else if ( option==\"oxygen molecule, O\u2082\"){\n   option3 ();\n   laycells ();\n  }\n  //\"beetle 4 stages\"\n  \n  else if ( option==\"nitrogen molecule, N\u2082\"){\n   option4 ();\n   laycells ();\n // textanswer=[1,2,3];\n  }\n  //\n  \n   else if ( option==\"hydrogen chloride, HCl\"){\n   option5 ();\n   laycells ();\n // textanswer=[1,2,3];\n  }\n  \n  else if ( option==\"hydroxide ion, OH\u207b\"){\n  option6 ();\n  laycells ();\n // textanswer=[1,2,3];\n  }\n  \n  // 2 atoms, 3 electrons sets\n  else if ( option==\"cyanide ion, CN\u207b\"){\n option7();\n laycells ();\n // textanswer=[1,2,3];\n  }\n  \n  // start of 3 atoms system\n  else if ( option==\"water, H\u2082O\"){\n  laycells3atoms ();\n  option8 ();\n // textanswer=[1,2,3];\n  }\n  \n  \n  \n  else if ( option==\"carbon dioxide, CO\u2082\"){\n  laycells3atomsq9 ();\n  option9 ();\n // textanswer=[1,2,3];\n  }\n  \n  \n   else if ( option==\"nitrite ion, NO\u2082\u207b\"){\n  laycells3atomsq9 ();\n  option10();\n // textanswer=[1,2,3];\n  }\n  \n  //start of 4 atoms systems\n  \n  \n  else if ( option==\"ammonia, NH\u2083\"){\n  laycells3atomsq11 ();\n  option11();\n // textanswer=[1,2,3];\n  }\n  //start of 5 atoms system\n  else if ( option==\"methane, CH\u2084\"){\n  laycells3atomsq12 ();\n  option12();\n // textanswer=[1,2,3];\n  }\n  else if ( option==\"carbonate ion, CO\u2083\u00b2\u207b\"){\n  laycells4atomsq13 ();\n  option13();\n // textanswer=[1,2,3];\n  }\n  //laycells4atomsq14 ()\n  else if ( option==\"hydrogen peroxide, H\u2082O\u2082\"){\n  laycells4atomsq14 ();\n  option14();\n // textanswer=[1,2,3];\n  }\n  \n  else if ( option==\"sulfate(IV) ions, SO\u2083\u00b2\u207b\"){\n  laycells4atomsq13 (); // same as CO3-2\n  option15();\n // textanswer=[1,2,3];\n  }\n  \n  else { // catch all 3 stages\n  \n    }\n  \n  \n  \n  //laycells ();\n  //_initialize();\n//layarrows ();\n//layanimals ();\nlayelectrons ();\n//assignpictures ();\n//hints ();\n//shuffleArray (xanimals); //last\ndisabled=true; // set combobox the disabled\nbackgroundcolor=\"LightGray\";\n"
                          },
                          {
                            "name": "Width",
                            "value": "\"25vw\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal 2vw \""
                          }
                        ]
                      },
                      {
                        "Name": "teachermode",
                        "Type": "CheckBox",
                        "Properties": [
                          {
                            "name": "Checked",
                            "value": "teachermode"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"teachermode\""
                          },
                          {
                            "name": "Text",
                            "value": "\"\ud83d\udc68\u200d\ud83c\udfeb\""
                          },
                          {
                            "name": "Font",
                            "value": "font"
                          },
                          {
                            "name": "Display",
                            "value": "\"none\""
                          }
                        ]
                      },
                      {
                        "Name": "twoStateButtoncheck",
                        "Type": "TwoStateButton",
                        "Properties": [
                          {
                            "name": "OffClick",
                            "value": "//catch all\nif (tryshowanswer==true){\n  _tools.showOkDialog(\"Need to drag the electrons and drop them again into the respective place holders again.\",\n   function(){ \n  tryshowanswer=false; //after \n  \n   _update(); // to force update view\n    });\n}\ninstantchecking (); // added to add up occupied 2345[ arrays]\nif (question==1){\n //1100\n \n check2atoms();\n \n \n \n // if (occupied[5]==true||occupied[6]==true||occupied[7]==true||occupied[8]==true||occupied[9]==true||occupied[10]==true||occupied[11]==true){\n    \n //  if (occupied2[21]==true||occupied2[22]==true||occupied2[23]==true||occupied2[24]==true||occupied2[25]==true||occupied2[26]==true||occupied2[27]==true){\n  if (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==0){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   //question=question+1;\n   _view.comboBox.setSelectedOptions([\"chlorine molecule, Cl\u2082\"]);\n  \n  laycells();\n   option2 ();\n   \n  // nanimals=7;\n // nanimals2=7;\n  // nanimals3=0;\n  // symbol=\"Cl\";\n   //symbol2=\"Cl\";\n      laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n\n }\n   else {//wrong\n\n      checkHint(question);\n      }\n  \n}\n\n\nelse if (question==2){\n  // check electronset 1 inside shared space\n  check2atoms();\n\n\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   //question=question+1;\n   _view.comboBox.setSelectedOptions([\"oxygen molecule, O\u2082\"]);\n  option3();\n  \n    laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              \n              \n      else {//wrong\n\n      checkHint(question);\n      }\n    }\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n \n \n \nelse  if (question==3){ //oxygen\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//2244 based on david's drawing\nif (sumsharede==2&&sumsharede2==2&&sumpersonale==4&&sumpersonale2==4){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n //  question=question+1;\n   _view.comboBox.setSelectedOptions([\"nitrogen molecule, N\u2082\"]);\n   option4 ();\n   \n    laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n\n        checkHint(question);\n      }\n      }\n      \n   \n   \n              \nelse if (question==4){ //nitrogen\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//3322 based on david's drawing\nif (sumsharede==3&&sumsharede2==3&&sumpersonale==2&&sumpersonale2==2){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n  // question=question+1;\n   _view.comboBox.setSelectedOptions([\"hydrogen chloride, HCl\"]);\n  option5();\n    laycells();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n                else {//wrong\n\n        checkHint(question);\n      }\n              }\n \n \n \n \nelse if (question==5){ //HCl\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n  // question=question+1;\n   _view.comboBox.setSelectedOptions([\"hydroxide ion, OH\u207b\"]);\n  option6();\n    laycells();\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n               else {//wrong\n\n        checkHint(question);\n      }\n              }\n\n\n \nelse if (question==6){ //OH\u207b\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==0){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n  // question=question+1;\n   _view.comboBox.setSelectedOptions([\"cyanide ion, CN\u207b\"]);\n   option7 ();\n    laycells();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n\n        checkHint(question);\n      }\n              }\n \n \n \n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"\",\"water, H\u2082O\",\"carbon dioxide, CO\u2082\",\"nitrite ion, NO\u2082\u207b\",\"\",\"carbonate ion, CO\u2083\u00b2\u207b\",\"ammonia, NH\u2083\",\"\",\"methane, CH\u2084\"]\n \nelse if (question==7){ //CN\u207b\n  // check electronset 1 inside shared space\n  check2atoms();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nif (sumsharede==2&&sumsharede2==4&&sumpersonale==2&&sumpersonale2==2){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"water, H\u2082O\"]);\n  option8 ();\n    laycells3atoms (); \n    \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n        checkHint(question);\n      }\n                   }\n \n \n else if (question==8){ //water, H\u2082O\n  // check electronset 1 inside shared space\n  check3atoms();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,2,4,0,0\nif (one==2&&two==2&&sumpersonale==4&&sumpersonale2==0&&sumpersonale3==0){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbon dioxide, CO\u2082\"]);\n  option9 ();\n   laycells3atomsq9 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n        checkHint(question);\n      }\n                   }\n \n \nelse if (question==9){ //carbon dioxide, CO\u2082\n  // check electronset 1 inside shared space\n  check3atomsq9();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//4,4,0,4,4\nif (one==4&&two==4&&sumpersonale==0&&sumpersonale2==4&&sumpersonale3==4){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"nitrite ion, NO\u2082\u207b\"]);\n  option10 ();\n   laycells3atoms ();\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n        checkHint(question);\n      }\n                   }\n \n   \n else if (question==10){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq9(); // same as q10\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,4,2,6,4\nif (one==2&&two==4&&sumpersonale==2&&sumpersonale2==6&&sumpersonale3==4){ //hole on RIGHT first\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n  option11 ();\n   laycells3atomsq11 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n                                                                      } //correct 1\n                                                                      //second correct 42246\n  else if (one==4&&two==2&&sumpersonale==2&&sumpersonale2==4&&sumpersonale3==6){ //hole on LEFT first\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n  option11 ();\n    laycells3atomsq11 ();\n    \n   //do this after click ok\n    _update(); // to force update view\n    });\n    } //correct 2\n                                                                      \n                                                                      \n                                                                      \n                                                                      else {//wrong\n\n        checkHint(question);\n      }\n                   }\n \n\nelse if (question==11){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq11(); // same as q10\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&sumpersonale==2&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"methane, CH\u2084\"]);\n  option12 ();\n    laycells3atomsq12 ();\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n        checkHint(question);\n      }\n                   }\n\nelse if (question==12){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq12(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\nvar four =sumsharede7+sumsharede8;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&four==2&&sumpersonale==0&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0&&sumpersonale5==0){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n  option13 ();\n    laycells3atomsq13 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n        checkHint(question);\n      }\n                   }\n                   \n                   else if (question==13){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq13(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,4,6,6,4\nif (one==2&&two==2&&three==4&&sumpersonale==0&&sumpersonale2==6&&sumpersonale3==6&&sumpersonale4==4){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n\n  //option13 ();\n   // laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n       checkHint(question);\n      }\n                   }\n\n    else if (question==14){ //hydrogen peroxide\n  // check electronset 1 inside shared space\n  check3atomsq14(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,2,4,4,0,0\nif (one==2&&two==2&&three==2&&sumpersonale==4&&sumpersonale2==4&&sumpersonale3==0&&sumpersonale4==0){\n   showCorrectWithMCQ(function(){\n\n\n   //do this after click ok\n   //_view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n   \n  //option13 ();\n   // laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n\n      checkHint(question);\n      }\n                   }\n\n  \n\nreturnelectron1 (); // to release lock on interaction\n_update(); // to force update view\n"
                          },
                          {
                            "name": "TextOn",
                            "value": "\"\ud83d\udc68\u200d\ud83c\udfeb\""
                          },
                          {
                            "name": "State",
                            "value": "teachermode"
                          },
                          {
                            "name": "TextOff",
                            "value": "\"\ud83e\udd14\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"game mechanism for practice and self check or Teacher Mode for teacher directed progress\""
                          },
                          {
                            "name": "Width",
                            "value": "\"10vw\""
                          },
                          {
                            "name": "OnClick",
                            "value": "//catch all\nif (tryshowanswer==true){\n  _tools.showOkDialog(\"Need to drag the electrons and drop them again into the respective place holders again.\",\n   function(){ \n  tryshowanswer=false; //after \n  \n   _update(); // to force update view\n    });\n}\ninstantchecking (); // added to add up occupied 2345[ arrays]\nif (question==1){\n //1100\n \n check2atoms();\n \n \n \n // if (occupied[5]==true||occupied[6]==true||occupied[7]==true||occupied[8]==true||occupied[9]==true||occupied[10]==true||occupied[11]==true){\n    \n //  if (occupied2[21]==true||occupied2[22]==true||occupied2[23]==true||occupied2[24]==true||occupied2[25]==true||occupied2[26]==true||occupied2[27]==true){\n  if (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\ud83e\udd17\",\n    function(){ \n   //do this after click ok\n   //question=question+1;\n  \n   \n  // nanimals=7;\n // nanimals2=7;\n  // nanimals3=0;\n  // symbol=\"Cl\";\n   //symbol2=\"Cl\";\n     \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n\n }\n   else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q1 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642\ufe0f\");\n      }\n  \n}\n\n\nelse if (question==2){\n  // check electronset 1 inside shared space\n  check2atoms();\n\n\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n   //question=question+1;\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              \n              \n      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q2 Incorrect!\");\n      }\n    }\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n \n \n \nelse  if (question==3){ //oxygen\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//2244 based on david's drawing\nif (sumsharede==2&&sumsharede2==2&&sumpersonale==4&&sumpersonale2==4){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n //  question=question+1;\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q3 Incorrect!\");\n      }\n      }\n      \n   \n   \n              \nelse if (question==4){ //nitrogen\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//3322 based on david's drawing\nif (sumsharede==3&&sumsharede2==3&&sumpersonale==2&&sumpersonale2==2){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n  // question=question+1;\n  \n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n                else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q4 Incorrect!\");\n      }\n              }\n \n \n \n \nelse if (question==5){ //HCl\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n  // question=question+1;\n   \n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n               else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q5 Incorrect!\");\n      }\n              }\n\n\n \nelse if (question==6){ //OH\u207b\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==0){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n  // question=question+1;\n  \n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q5 Incorrect!\");\n      }\n              }\n \n \n \n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"\",\"water, H\u2082O\",\"carbon dioxide, CO\u2082\",\"nitrite ion, NO\u2082\u207b\",\"\",\"carbonate ion, CO\u2083\u00b2\u207b\",\"ammonia, NH\u2083\",\"\",\"methane, CH\u2084\"]\n \nelse if (question==7){ //CN\u207b\n  // check electronset 1 inside shared space\n  check2atoms();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nif (sumsharede==2&&sumsharede2==4&&sumpersonale==2&&sumpersonale2==2){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n  \n    \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q7 Incorrect!\");\n      }\n                   }\n \n \n else if (question==8){ //water, H\u2082O\n  // check electronset 1 inside shared space\n  check3atoms();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,2,4,0,0\nif (one==2&&two==2&&sumpersonale==4&&sumpersonale2==0&&sumpersonale3==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n  \n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q8 Incorrect!\");\n      }\n                   }\n \n \nelse if (question==9){ //carbon dioxide, CO\u2082\n  // check electronset 1 inside shared space\n  check3atomsq9();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//4,4,0,4,4\nif (one==4&&two==4&&sumpersonale==0&&sumpersonale2==4&&sumpersonale3==4){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n   \n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q9 Incorrect!\");\n      }\n                   }\n \n   \n else if (question==10){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq9(); // same as q10\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,4,2,6,4\nif (one==2&&two==4&&sumpersonale==2&&sumpersonale2==6&&sumpersonale3==4){ //hole on RIGHT first\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct! foreign electron is on the right, but it can also be on the left atom\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n  option11 ();\n   laycells3atomsq11 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n                                                                      } //correct 1\n                                                                      //second correct 42246\n  else if (one==4&&two==2&&sumpersonale==2&&sumpersonale2==4&&sumpersonale3==6){ //hole on LEFT first\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!, foreign electron is on the left, but it can also be on the right atom\",\n    function(){ \n   //do this after click ok\n \n    \n   //do this after click ok\n    _update(); // to force update view\n    });\n    } //correct 2\n                                                                      \n                                                                      \n                                                                      \n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q10 Incorrect!\");\n      }\n                   }\n \n\nelse if (question==11){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq11(); // same as q10\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&sumpersonale==2&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n  \n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q11 Incorrect!\");\n      }\n                   }\n\nelse if (question==12){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq12(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\nvar four =sumsharede7+sumsharede8;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&four==2&&sumpersonale==0&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0&&sumpersonale5==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n  \n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q12 Incorrect!\");\n      }\n                   }\n                   \n                   else if (question==13){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq13(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,4,6,6,4\nif (one==2&&two==2&&three==4&&sumpersonale==0&&sumpersonale2==6&&sumpersonale3==6&&sumpersonale4==4){\n  _view.audio.play(); // good ding\n  _tools.showOkDialog(\"Correct! \",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n\n  //option13 ();\n   // laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q13 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642\ufe0f\");\n      }\n                   }\n\n    else if (question==14){ //hydrogen peroxide\n  // check electronset 1 inside shared space\n  check3atomsq14(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,2,4,4,0,0\nif (one==2&&two==2&&three==2&&sumpersonale==4&&sumpersonale2==4&&sumpersonale3==0&&sumpersonale4==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!,End of Quiz \",\n    function(){ \n   //do this after click ok\n   //_view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n   \n  //option13 ();\n   // laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q14 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642\ufe0f\");\n      }\n                   }\n\n  \n\nreturnelectron1 (); // to release lock on interaction\n_update(); // to force update view\n"
                          },
                          {
                            "name": "Font",
                            "value": "font"
                          },
                          {
                            "name": "Display",
                            "value": "\"none\""
                          }
                        ]
                      },
                      {
                        "Name": "check2broken",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Tooltip",
                            "value": "\"game mechanism for practice and self check\""
                          },
                          {
                            "name": "Text",
                            "value": "\"\ud83e\udd14\""
                          },
                          {
                            "name": "Width",
                            "value": "\"10vw\""
                          },
                          {
                            "name": "OnClick",
                            "value": "//catch all\nif (tryshowanswer==true){\n  _tools.showOkDialog(\"Need to drag the electrons and drop them again into the respective place holders again.\",\n   function(){ \n  tryshowanswer=false; //after \n  \n   _update(); // to force update view\n    });\n}\n\n\ninstantchecking (); // added to add up occupied 2345[ arrays]\n\n\nif (question==1){\n //1100\n \n check2atoms();\n \n \n \n // if (occupied[5]==true||occupied[6]==true||occupied[7]==true||occupied[8]==true||occupied[9]==true||occupied[10]==true||occupied[11]==true){\n    \n //  if (occupied2[21]==true||occupied2[22]==true||occupied2[23]==true||occupied2[24]==true||occupied2[25]==true||occupied2[26]==true||occupied2[27]==true){\n  if (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\ud83e\udd17\",\n    function(){ \n   //do this after click ok\n   //question=question+1;\n   _view.comboBox.setSelectedOptions([\"chlorine molecule, Cl\u2082\"]);\n  \n  laycells();\n   option2 ();\n   \n  // nanimals=7;\n // nanimals2=7;\n  // nanimals3=0;\n  // symbol=\"Cl\";\n   //symbol2=\"Cl\";\n      laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n\n }\n   else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q1 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642\ufe0f\");\n      }\n  \n}\n\n\nelse if (question==2){\n  // check electronset 1 inside shared space\n  check2atoms();\n\n\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n   //question=question+1;\n   _view.comboBox.setSelectedOptions([\"oxygen molecule, O\u2082\"]);\n  option3();\n  \n    laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              \n              \n      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q2 Incorrect!\");\n      }\n    }\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n \n \n \nelse  if (question==3){ //oxygen\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//2244 based on david's drawing\nif (sumsharede==2&&sumsharede2==2&&sumpersonale==4&&sumpersonale2==4){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n //  question=question+1;\n   _view.comboBox.setSelectedOptions([\"nitrogen molecule, N\u2082\"]);\n   option4 ();\n   \n    laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q3 Incorrect!\");\n      }\n      }\n      \n   \n   \n              \nelse if (question==4){ //nitrogen\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//3322 based on david's drawing\nif (sumsharede==3&&sumsharede2==3&&sumpersonale==2&&sumpersonale2==2){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n  // question=question+1;\n   _view.comboBox.setSelectedOptions([\"hydrogen chloride, HCl\"]);\n  option5();\n    laycells();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n                else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q4 Incorrect!\");\n      }\n              }\n \n \n \n \nelse if (question==5){ //HCl\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n  // question=question+1;\n   _view.comboBox.setSelectedOptions([\"hydroxide ion, OH\u207b\"]);\n  option6();\n    laycells();\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n               else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q5 Incorrect!\");\n      }\n              }\n\n\n \nelse if (question==6){ //OH\u207b\n  // check electronset 1 inside shared space\n  check2atoms();\n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==0){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n   //do this after click ok\n  // question=question+1;\n   _view.comboBox.setSelectedOptions([\"cyanide ion, CN\u207b\"]);\n   option7 ();\n    laycells();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q5 Incorrect!\");\n      }\n              }\n \n \n \n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"\",\"water, H\u2082O\",\"carbon dioxide, CO\u2082\",\"nitrite ion, NO\u2082\u207b\",\"\",\"carbonate ion, CO\u2083\u00b2\u207b\",\"ammonia, NH\u2083\",\"\",\"methane, CH\u2084\"]\n \nelse if (question==7){ //CN\u207b\n  // check electronset 1 inside shared space\n  check2atoms();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nif (sumsharede==2&&sumsharede2==4&&sumpersonale==2&&sumpersonale2==2){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"water, H\u2082O\"]);\n  option8 ();\n    laycells3atoms (); \n    \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q7 Incorrect!\");\n      }\n                   }\n \n \n else if (question==8){ //water, H\u2082O\n  // check electronset 1 inside shared space\n  //check3atoms();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,2,4,0,0\nif (one==2&&two==2&&sumpersonale==4&&sumpersonale2==0&&sumpersonale3==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbon dioxide, CO\u2082\"]);\n  option9 ();\n   laycells3atomsq9 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q8 Incorrect!\");\n      }\n                   }\n \n \nelse if (question==9){ //carbon dioxide, CO\u2082\n  // check electronset 1 inside shared space\n  check3atomsq9();\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//4,4,0,4,4\nif (one==4&&two==4&&sumpersonale==0&&sumpersonale2==4&&sumpersonale3==4){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"nitrite ion, NO\u2082\u207b\"]);\n  option10 ();\n   laycells3atoms ();\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q9 Incorrect!\");\n      }\n                   }\n \n   \n else if (question==10){ //nitrite ion, NO\u2082\u207b\n  // check electronset 1 inside shared space\n  check3atomsq9(); // same as q10\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,4,2,6,4\nif (one==2&&two==4&&sumpersonale==2&&sumpersonale2==6&&sumpersonale3==4){ //hole on RIGHT first\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct! foreign electron is on the right, but it can also be on the left atom\",\n    function(){ \n   //do this after click ok\n   //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"water, H\u2082O\",\"ammonia, NH\u2083\",\"carbon dioxide, CO\u2082\",\"methane, CH\u2084\",\"hydrogen peroxide,H\u2082O\u2082\",\"Polyatomic Ions (Advanced Level)\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n   _view.comboBox.setSelectedOptions([\"ammonia, NH\u2083\"]); //NH3\n  option11 ();\n   laycells3atomsq11 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n                                                                      } //correct 1\n//second correct 42246\n  else if (one==4&&two==2&&sumpersonale==2&&sumpersonale2==4&&sumpersonale3==6){ //hole on LEFT first\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!, foreign electron is on the left, but it can also be on the right atom\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"ammonia, NH\u2083\"]);\n  option11 ();\n    laycells3atomsq11 ();\n    \n   //do this after click ok\n    _update(); // to force update view\n    });\n    } //correct 2\n                                                                      \n                                                                      \n                                                                      \n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q10 Incorrect!\");\n      }\n                   }\n \n\nelse if (question==11){ //ammonia, NH\u2083\n  // check electronset 1 inside shared space\n  check3atomsq11(); // same as q10\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&sumpersonale==2&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"methane, CH\u2084\"]);\n  option12 ();\n    laycells3atomsq12 ();\n  \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q11 Incorrect!\");\n      }\n                   }\n\nelse if (question==12){ //methane\n  // check electronset 1 inside shared space\n  check3atomsq12(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\nvar four =sumsharede7+sumsharede8;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&four==2&&sumpersonale==0&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0&&sumpersonale5==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n  option13 ();\n    laycells4atomsq13 ();\n   \n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Q12 Incorrect!\");\n      }\n                   }\n                   \n                   else if (question==13){ //CO3-2\n  // check electronset 1 inside shared space\n  check3atomsq13(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,4,6,6,4\nif (one==2&&two==2&&three==4&&sumpersonale==0&&sumpersonale2==6&&sumpersonale3==6&&sumpersonale4==4){\n  _view.audio.play(); // good ding\n  _tools.showOkDialog(\"Correct! \",\n    function(){ \n   //do this after click ok\n   _view.comboBox.setSelectedOptions([\"hydrogen peroxide,H\u2082O\u2082\"]);\n\n  option14 ();\n   laycells4atomsq14 ();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q13 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642\ufe0f\");\n      }\n                   }\n\n    else if (question==14){ //hydrogen peroxide\n  // check electronset 1 inside shared space\n  check3atomsq14(); // same as q12 is same as q11\n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,2,4,4,0,0\nif (one==2&&two==2&&three==2&&sumpersonale==4&&sumpersonale2==4&&sumpersonale3==0&&sumpersonale4==0){\n   _view.audio.play(); // good ding\n   _tools.showOkDialog(\"Correct!,End of Quiz \",\n    function(){ \n   //do this after click ok\n   //_view.comboBox.setSelectedOptions([\"carbonate ion, CO\u2083\u00b2\u207b\"]);\n   \n  //option13 ();\n   // laycells();\n   //do this after click ok\n    _update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q14 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642\ufe0f\");\n      }\n                   }\n\n  \n\n\nreturnelectron1 (); // to release lock on interaction\n_update(); // to force update view"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal 2vw\""
                          },
                          {
                            "name": "Display",
                            "value": "\"none\""
                          }
                        ]
                      },
                      {
                        "Name": "check",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Tooltip",
                            "value": "\"game mechanism for practice and self check\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Check \ud83e\udd14\""
                          },
                          {
                            "name": "OnPress",
                            "value": "instantchecking ();//need this to solve bug of missing correct answers"
                          },
                          {
                            "name": "Width",
                            "value": "\"20vw\""
                          },
                          {
                            "name": "OnClick",
                            "value": "\n\n\n\nif (question==1){\n //1100\n \n //check2atoms();\n \n \n \n // if (occupied[5]==true||occupied[6]==true||occupied[7]==true||occupied[8]==true||occupied[9]==true||occupied[10]==true||occupied[11]==true){\n    \n //  if (occupied2[21]==true||occupied2[22]==true||occupied2[23]==true||occupied2[24]==true||occupied2[25]==true||occupied2[26]==true||occupied2[27]==true){\n  if (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==0){\n   _view.audio.play(); // good ding\n  scoreIndividual[1] = 1;\n     _tools.showOkDialog(\"Correct!\", \n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n\n }\n   else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Question hydrogen molecule, H\u2082 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642 Hint: How many more electrons does the hydrogen atom needs to achieve a full shell and become stable?\ufe0f\");\n   //   document.getElementById(\".myBoxPanelOk\").style.width = \"50%\";\n      }\n  \n}\n\n\nelse if (question==2){//chlorine molecule, Cl\u2082\n\n\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n  scoreIndividual[2] = 1;\n  _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n              } //correct\n              \n              \n      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Question chlorine molecule, Cl\u2082 Incorrect! Hint: How many more electrons does the chlorine atom needs to achieve a full valence shell and become stable?\");\n    //  document.getElementById(\".myBoxPanelOk\").style.width = \"50%\";\n   \n   }\n    }\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n \n \n \nelse  if (question==3){ // oxygen molecule, O\u2082\n  \n//2244 based on david's drawing\nif (sumsharede==2&&sumsharede2==2&&sumpersonale==4&&sumpersonale2==4){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n scoreIndividual[3] = 1;\n  _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question oxygen molecule, O\u2082 Incorrect! Hint: How many more electrons does the oxygen atom needs to achieve a full valence shell and become stable?\");\n      }\n      }\n      \n   \n   \n              \nelse if (question==4){ //nitrogen molecule, N\u2082\n  \n//3322 based on david's drawing\nif (sumsharede==3&&sumsharede2==3&&sumpersonale==2&&sumpersonale2==2){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n  scoreIndividual[4] = 1;\n   _view.audio.play(); // good ding\n   _view.audiowhistle.play(); \n   _tools.showOkDialog(\"Correct!\", \n    function(){ \n  \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n              } //correct\n                else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question nitrogen molecule, N\u2082 Incorrect! Hint: How many more electrons does the nitrogen atom needs to achieve a full valence shell and become stable?\");\n      }\n              }\n \n \n \n \nelse if (question==5){ //hydrogen chloride, HCl\n \n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==0&&sumpersonale2==6){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n  scoreIndividual[5] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n              } //correct\n               else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question hydrogen chloride, HCl Incorrect! Hint: How many more electrons does the chlorine/hydrogen atom needs to achieve a full valence shell and become stable? That is the number of electron(s) that will have to be shared from the other atom.\");\n      }\n              }\n\n\n \nelse if (question==6){ //hydroxide ion, OH\u207b\n  \n\n//1106 based on david's drawing\nif (sumsharede==1&&sumsharede2==1&&sumpersonale==6&&sumpersonale2==0){\n  //if occupied[5],occupied[6],occupied[7],occupied[8],occupied[9],occupied[10],occupied[11] , only one is true, the rest must be false\n  // is there a function or code to do that? \n   _view.audio.play(); // good ding\n   scoreIndividual[6] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n              } //correct\n              else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question hydroxide ion, OH\u207b Incorrect! Hint: Move the electrons from hydrogen and oxygen first. Then move the foreign electron.\");\n      }\n              }\n \n \n \n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"carbon dioxide, CO\u2082\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n //[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"\",\"water, H\u2082O\",\"carbon dioxide, CO\u2082\",\"nitrite ion, NO\u2082\u207b\",\"\",\"carbonate ion, CO\u2083\u00b2\u207b\",\"ammonia, NH\u2083\",\"\",\"methane, CH\u2084\"]\n \nelse if (question==7){ //cyanide ion, CN\u207b\n \n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one = sumsharede+sumsharede2;\n\nif (sumsharede2==3&&one==6&&sumpersonale==2&&sumpersonale2==2){\n//if (sumsharede==2&&sumsharede2==4&&sumpersonale==2&&sumpersonale2==2){\n   _view.audio.play(); // good ding\n   _view.audiowhistle.play(); // good ding\n   scoreIndividual[7] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question cyanide ion, CN\u207b Incorrect! Hint:Move the electrons from carbon and nitrogen first. Then move the foreign electron.\");\n      }\n                   }\n \n \n else if (question==8){ //water, H\u2082O\n  \nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,2,4,0,0\nif (one==2&&two==2&&sumpersonale==4&&sumpersonale2==0&&sumpersonale3==0){\n   _view.audio.play(); // good ding\n   scoreIndividual[8] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question water, H\u2082O Incorrect! Hint: How many more electrons does the oxygen/hydrogen atom needs to achieve a full valence shell and become stable? That is the number of electron(s) that will have to be shared from the other atom(s).\");\n      }\n                   }\n \n \nelse if (question==9){ //carbon dioxide, CO\u2082\n  \n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//4,4,0,4,4\nif (one==4&&two==4&&sumpersonale==0&&sumpersonale2==4&&sumpersonale3==4){\n   _view.audio.play(); // good ding\n    _view.audiotada.play(); // good ding\n   scoreIndividual[9] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question carbon dioxide, CO\u2082 Incorrect! Hint: How many more electrons does the carbon/oxygen atom needs to achieve a full valence shell and become stable? That is the number of electron(s) that will have to be shared from the other atom(s).\");\n      }\n                   }\n \n   \n else if (question==10){ //nitrite ion, NO\u2082\u207b\n  \nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\n//2,4,2,6,4\nif (one==2&&two==4&&sumpersonale==2&&sumpersonale2==6&&sumpersonale3==4){ //hole on RIGHT first\n   _view.audio.play(); // good ding\n   scoreIndividual[10] = 1;\n   _tools.showOkDialog(\"Correct! \",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n                                                                      } //correct 1\n//second correct 42246\n  else if (one==4&&two==2&&sumpersonale==2&&sumpersonale2==4&&sumpersonale3==6){ //hole on LEFT first\n   _view.audio.play(); // good ding\n scoreIndividual[10] = 1;\n  _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n    } //correct 2\n                                                                      \n                                                                      \n                                                                      \n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question nitrite ion, NO\u2082\u207b Incorrect! Hint: Move the electrons from nitrogen and oxygen first. Then move the foreign electron.\");\n      }\n                   }\n \n\nelse if (question==11){ //ammonia, NH\u2083\n \nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&sumpersonale==2&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0){\n   _view.audio.play(); // good ding\n scoreIndividual[11] = 1;\n  _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question ammonia, NH\u2083 Incorrect! Hint: How many more electrons does the nitrogen/hydrogen atom needs to achieve a full valence shell and become stable? That is the number of electron(s) that will have to be shared from the other atom(s).\");\n      }\n                   }\n//\"nitrite ion, NO\u2082\u207b\",\"\",\"carbonate ion, CO\u2083\u00b2\u207b\",\"ammonia, NH\u2083\",\"\",\"methane, CH\u2084\"\nelse if (question==12){ //methane, CH\u2084\n  \n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\nvar four =sumsharede7+sumsharede8;\n//2,4,2,6,4\nif (one==2&&two==2&&three==2&&four==2&&sumpersonale==0&&sumpersonale2==0&&sumpersonale3==0&&sumpersonale4==0&&sumpersonale5==0){\n   _view.audio.play(); // good ding\n   scoreIndividual[12] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n       _view.audio2.play(); // wrong ding\n       _tools.showOkDialog(\"Question methane, CH\u2084 Incorrect! Hint: How many more electrons does the carbon/hydrogen atom needs to achieve a full valence shell and become stable? That is the number of electron(s) that will have to be shared from the other atom(s).\");\n      }\n                   }\n                   \n                   else if (question==13){ //carbonate ion, CO\u2083\u00b2\u207b\n  \n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,4,6,6,4 case 1\n// 422466\n//2240664\nif ((one==2&&two==2&&three==4&&sumpersonale==0&&sumpersonale2==6&&sumpersonale3==6&&sumpersonale4==4)||(one==4&&two==2&&three==2&&sumpersonale==0&&sumpersonale2==4&&sumpersonale3==6&&sumpersonale4==6)||(one==2&&two==4&&three==2&&sumpersonale==0&&sumpersonale2==6&&sumpersonale3==4&&sumpersonale4==6)){\n  _view.audio.play(); // good ding\n  _view.audioclap.play(); // clap\n scoreIndividual[13] = 1;\n _tools.showOkDialog(\"Correct! \",\n    function(){ \n  \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Question carbonate ion, CO\u2083\u00b2\u207b Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642 Hint: Move the electrons from carbon and oxygen first. Then move the foreign electron.\ufe0f\");\n      }\n                   }\n//[\"hydrogen molecule, H\u2082\",\"chlorine molecule, Cl\u2082\",\"oxygen molecule, O\u2082\",\"nitrogen molecule, N\u2082\",\"hydrogen chloride, HCl\",\"water, H\u2082O\",\"ammonia, NH\u2083\",\"carbon dioxide, CO\u2082\",\"methane, CH\u2084\",\"hydrogen peroxide,H\u2082O\u2082\",\"Polyatomic Ions (Advanced Level)\",\"hydroxide ion, OH\u207b\",\"cyanide ion, CN\u207b\",\"nitrite ion, NO\u2082\u207b\",\"carbonate ion, CO\u2083\u00b2\u207b\"]\n    else if (question==14){ //hydrogen peroxide\n  \n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,2,4,4,0,0\nif (one==2&&two==2&&three==2&&sumpersonale==4&&sumpersonale2==4&&sumpersonale3==0&&sumpersonale4==0){\n   _view.audio.play(); // good ding\n   _view.audioclap.play(); // clap\n  scoreIndividual[14] = 1;\n   _tools.showOkDialog(\"Correct!\",\n    function(){ \n   \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Question hydrogen peroxide,H\u2082O\u2082 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642 Hint: How many more electrons does the oxygen/hydrogen atom needs to achieve a full valence shell and become stable? That is the number of electron(s) that will have to be shared from the other atom(s).\ufe0f\");\n      }\n                   }\n\n  \nelse if (question==15){ //SO3-2\n  \n//alert(sumsharede+\" , \"+sumsharede2+\" , \" +sumpersonale+\" , \" +sumpersonale2);\n//242(1+1) based on david's drawing\nvar one =sumsharede+sumsharede2;\nvar two =sumsharede3+sumsharede4;\nvar three =sumsharede5+sumsharede6;\n//var four =sumsharede7+sumsharede8;\n//2,2,4,6,6,4 case 1\n// 422466\n//2240664\nif ((one==2&&two==2&&three==4&&sumpersonale==2&&sumpersonale2==6&&sumpersonale3==6&&sumpersonale4==4)||(one==4&&two==2&&three==2&&sumpersonale==2&&sumpersonale2==4&&sumpersonale3==6&&sumpersonale4==6)||(one==2&&two==4&&three==2&&sumpersonale==2&&sumpersonale2==6&&sumpersonale3==4&&sumpersonale4==6)){\n  _view.audio.play(); // good ding\n  scoreIndividual[15] = 1;\n  _tools.showOkDialog(\"Correct! \",\n    function(){ \n  \n    // Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n    });\n   \n  \n                                                                      } //correct\n                                                                      else {//wrong\n      _view.audio2.play(); // wrong ding\n      _tools.showOkDialog(\"Q15 Incorrect!\ud83e\udd26\ud83c\udffc\u200d\u2642 Hint: Move the electrons from sulphur and oxygen first. Then move the foreign electron. Remember expanded octet so sulphur has 10 electrons\ufe0f\");\n      }\n                   }\ninstantchecking (); // added to add up occupied 2345[ arrays]\n\nreturnelectron1 (); // to release lock on interaction\n\nvar tmp  = Number(_view.comboBox.getSelectedOptionsIndexes());\ntmp = tmp+1;\n\n//score\nscore=0;\nfor (var i=1; i<=15 ; i++) {\n score = score+scoreIndividual[i];\n}\n\n\n\n\n// Award stars on correct answer; count wrong attempt for star rating\nif (scoreIndividual[question] === 1) {\n computeStars();\n} else {\n attemptq++;\n}\n\n_update(); // to force update view\n\n\n"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal 2vw\""
                          }
                        ]
                      },
                      {
                        "Name": "showanswer",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Tooltip",
                            "value": "\"hints, show possible position of electrons\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Reveal \ud83d\udcd6\""
                          },
                          {
                            "name": "Width",
                            "value": "\"20vw\""
                          },
                          {
                            "name": "OnClick",
                            "value": "returnelectron1 (); //need to reset to zero occupied for all\n\nif (question==1){\n// something you want to click then do something\n EJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n    xanimals[0]= xcell[7];\n    yanimals[0]= ycell[7];\n//xanimalsanimation[0]= xcell[7];\n//yanimalsanimation[0]= ycell[7];\nxanimals2[0]= xcell2[24];\nyanimals2[0]= ycell2[24];\n//xanimals2animation[0]= xcell2[24];\n//yanimals2animation[0]= ycell2[24];\n    instantchecking ();\n    _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n}\nelse if (question==2){\n\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared\nxanimals[0]= xcell[7];\nyanimals[0]= ycell[7];\nxanimals2[0]= xcell2[24];\nyanimals2[0]= ycell2[24];\n//1st atom personal top\nxanimals[1]= xcell[1];\nyanimals[1]= ycell[1];\nxanimals[2]= xcell[31];\nyanimals[2]= ycell[31];\n//1st atom personal left\nxanimals[3]= xcell[25];\nyanimals[3]= ycell[25];\nxanimals[4]= xcell[23];\nyanimals[4]= ycell[23];\n//1st atom personal bottom\nxanimals[5]= xcell[17];\nyanimals[5]= ycell[17];\nxanimals[6]= xcell[15];\nyanimals[6]= ycell[15];\n\n//2nd atom personal top\nxanimals2[1]= xcell2[31];\nyanimals2[1]= ycell2[31];\nxanimals2[2]= xcell2[1];\nyanimals2[2]= ycell2[1];\n//2nd atom personal right\nxanimals2[3]= xcell2[7];\nyanimals2[3]= ycell2[7];\nxanimals2[4]= xcell2[9];\nyanimals2[4]= ycell2[9];\n//2nd atom personal bottom\nxanimals2[5]= xcell2[15];\nyanimals2[5]= ycell2[15];\nxanimals2[6]= xcell2[17];\nyanimals2[6]= ycell2[17];\n\n/*\n//shared\nxanimalsanimation[0]= xcell[7];\nyanimalsanimation[0]= ycell[7];\nxanimals2animation[0]= xcell2[24];\nyanimals2animation[0]= ycell2[24];\n//1st atom personal top\nxanimalsanimation[1]= xcell[1];\nyanimalsanimation[1]= ycell[1];\nxanimalsanimation[2]= xcell[31];\nyanimalsanimation[2]= ycell[31];\n//1st atom personal left\nxanimalsanimation[3]= xcell[25];\nyanimalsanimation[3]= ycell[25];\nxanimalsanimation[4]= xcell[23];\nyanimalsanimation[4]= ycell[23];\n//1st atom personal bottom\nxanimalsanimation[5]= xcell[17];\nyanimalsanimation[5]= ycell[17];\nxanimalsanimation[6]= xcell[15];\nyanimalsanimation[6]= ycell[15];\n\n//2nd atom personal top\nxanimals2animation[1]= xcell2[31];\nyanimals2animation[1]= ycell2[31];\nxanimals2animation[2]= xcell2[1];\nyanimals2animation[2]= ycell2[1];\n//2nd atom personal right\nxanimals2animation[3]= xcell2[7];\nyanimals2animation[3]= ycell2[7];\nxanimals2animation[4]= xcell2[9];\nyanimals2animation[4]= ycell2[9];\n//2nd atom personal bottom\nxanimals2animation[5]= xcell2[15];\nyanimals2animation[5]= ycell2[15];\nxanimals2animation[6]= xcell2[17];\nyanimals2animation[6]= ycell2[17];\n*/\ninstantchecking ();\n_update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n\n}\nelse if (question==3){ //O2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n //shared\nxanimals[0]= xcell[5];\nyanimals[0]= ycell[5];\nxanimals[1]= xcell[9];\nyanimals[1]= ycell[9];\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\nxanimals2[1]= xcell2[22];\nyanimals2[1]= ycell2[22];\n//1st atom personal top left\nxanimals[2]= xcell[30];\nyanimals[2]= ycell[30];\nxanimals[3]= xcell[28];\nyanimals[3]= ycell[28];\n//1st atom personal bottom left\nxanimals[4]= xcell[20];\nyanimals[4]= ycell[20];\nxanimals[5]= xcell[18];\nyanimals[5]= ycell[18];\n\n\n//2nd atom personal top right\nxanimals2[2]= xcell2[2];\nyanimals2[2]= ycell2[2];\nxanimals2[3]= xcell2[4];\nyanimals2[3]= ycell2[4];\n//2nd atom personal bottom right\nxanimals2[4]= xcell2[12];\nyanimals2[4]= ycell2[12];\nxanimals2[5]= xcell2[14];\nyanimals2[5]= ycell2[14];\n   instantchecking ();\n   _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n    \n\n\n\n}\n\nelse if (question==4){ //N2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n      //shared\nxanimals[0]= xcell[5];\nyanimals[0]= ycell[5];\nxanimals[1]= xcell[7];\nyanimals[1]= ycell[7];\nxanimals[2]= xcell[9];\nyanimals[2]= ycell[9];\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\nxanimals2[1]= xcell2[24];\nyanimals2[1]= ycell2[24];\nxanimals2[2]= xcell2[22];\nyanimals2[2]= ycell2[22];\n//1st atom personal left\nxanimals[3]= xcell[25];\nyanimals[3]= ycell[25];\nxanimals[4]= xcell[23];\nyanimals[4]= ycell[23];\n\n\n\n//2nd atom personal  right\n\nxanimals2[3]= xcell2[7];\nyanimals2[3]= ycell2[7];\nxanimals2[4]= xcell2[9];\nyanimals2[4]= ycell2[9];\n   instantchecking ();\n   _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n   \n\n\n\n}\nelse if (question==5){\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \nxanimals[0]= xcell[7];\nyanimals[0]= ycell[7];\nxanimals2[0]= xcell2[24];\nyanimals2[0]= ycell2[24];\n\n//2nd atom personal  top \n\nxanimals2[1]= xcell2[31];\nyanimals2[1]= ycell2[31];\nxanimals2[2]= xcell2[1];\nyanimals2[2]= ycell2[1];\n//2nd atom personal  right \n\nxanimals2[3]= xcell2[7];\nyanimals2[3]= ycell2[7];\nxanimals2[4]= xcell2[9];\nyanimals2[4]= ycell2[9];\n//2nd atom personal  bottom \n\nxanimals2[5]= xcell2[15];\nyanimals2[5]= ycell2[15];\nxanimals2[6]= xcell2[17];\nyanimals2[6]= ycell2[17];\n   instantchecking ();\n   _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n}\n\nelse if (question==6){ //OH-\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \nxanimals[0]= xcell[7];\nyanimals[0]= ycell[7];\nxanimals2[0]= xcell2[24];\nyanimals2[0]= ycell2[24];\n\n//1 atom personal  top \n\nxanimals[1]= xcell[31];\nyanimals[1]= ycell[31];\nxanimals[2]= xcell[1];\nyanimals[2]= ycell[1];\n//1atom personal  right \n\nxanimals[3]= xcell[25];\nyanimals[3]= ycell[25];\nxanimals[4]= xcell[23];\nyanimals[4]= ycell[23];\n//1atom personal  bottom \n\nxanimals[5]= xcell[15];\nyanimals[5]= ycell[15];\n//xanimals[6]= xcell[17];\n//yanimals[6]= ycell[17];\nxanimals3[0]= xcell[17]; //foreign e\nyanimals3[0]= ycell[17];\n   instantchecking ();\n   _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n}\n\n\nelse if (question==7){ //CN-\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning!!! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n //shared\nxanimals[0]= xcell[5];\nyanimals[0]= ycell[5];\nxanimals[1]= xcell[7];\nyanimals[1]= ycell[7];\nxanimals[2]= xcell[9];\nyanimals[2]= ycell[9];\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\nxanimals2[1]= xcell2[24];\nyanimals2[1]= ycell2[24];\nxanimals2[2]= xcell2[22];\nyanimals2[2]= ycell2[22];\n//xanimals2[3]= xcell2[23];\n//yanimals2[3]= ycell2[23];\n\n//1st atom personal left\nxanimals[3]= xcell[25];\nyanimals[3]= ycell[25];\nxanimals3[0]= xcell[23]; //foreign\nyanimals3[0]= ycell[23];\n//xanimals[4]= xcell[23];\n//yanimals[4]= ycell[23];\n\n\n\n//2nd atom personal  right\n\n//xanimals3[0]= xcell2[7]; //foreign\n//yanimals3[0]= ycell2[7];\nxanimals2[4]= xcell2[9];\nyanimals2[4]= ycell2[9];\nxanimals2[3]= xcell2[7]; //added to correct a mistake 20200113\nyanimals2[3]= ycell2[7];\n   instantchecking ();\n   _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n\n}\nelse if (question==8){ //H20\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared\nxanimals[0]= xcell[11];// R side\nyanimals[0]= ycell[11];\nxanimals[1]= xcell[21];// L side\nyanimals[1]= ycell[21];\n\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\n\nxanimals3[0]= xcell3[4];\nyanimals3[0]= ycell3[4];\n//1st atom personal left top\nxanimals[2]= xcell[27];\nyanimals[2]= ycell[27];\nxanimals[3]= xcell[29];\nyanimals[3]= ycell[29];\nxanimals[4]= xcell[3];\nyanimals[4]= ycell[3];\nxanimals[5]= xcell[5];\nyanimals[5]= ycell[5];\n   instantchecking ();\n   _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n\n}\nelse if (question==9){ //CO2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared R\nxanimals[0]= xcell[5];\nyanimals[0]= ycell[5];\nxanimals[1]= xcell[10];\nyanimals[1]= ycell[10];\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\nxanimals2[1]= xcell2[21];\nyanimals2[1]= ycell2[21];\n//shared L\nxanimals[2]= xcell[27];\nyanimals[2]= ycell[27];\nxanimals[3]= xcell[22];\nyanimals[3]= ycell[22];\nxanimals3[0]= xcell3[6];\nyanimals3[0]= ycell3[6];\nxanimals3[1]= xcell3[11];\nyanimals3[1]= ycell3[11];\n\n\n\n//2nd atom personal  right\nxanimals2[2]= xcell2[2];\nyanimals2[2]= ycell2[2];\nxanimals2[3]= xcell2[4];\nyanimals2[3]= ycell2[4];\nxanimals2[4]= xcell2[12];\nyanimals2[4]= ycell2[12];\nxanimals2[5]= xcell2[14];\nyanimals2[5]= ycell2[14];\n\n//3 atom personal  left\nxanimals3[2]= xcell3[30];\nyanimals3[2]= ycell3[30];\nxanimals3[3]= xcell3[28];\nyanimals3[3]= ycell3[28];\nxanimals3[4]= xcell3[20];\nyanimals3[4]= ycell3[20];\nxanimals3[5]= xcell3[18];\nyanimals3[5]= ycell3[18];\ninstantchecking ();\n    _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n}\nelse if (question==10){ //NO-2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared R\nxanimals[0]= xcell[9]; //bottom\nyanimals[0]= ycell[9];\nxanimals[1]= xcell[6];\nyanimals[1]= ycell[6]; //top\nxanimals2[0]= xcell2[25];\nyanimals2[0]= ycell2[25];\nxanimals2[1]= xcell2[22];\nyanimals2[1]= ycell2[22];\n\n//shared L\nxanimals[2]= xcell[23];\nyanimals[2]= ycell[23];\n\nxanimals3[0]= xcell3[7];\nyanimals3[0]= ycell3[7];\n\n//1st atom personal \nxanimals[3]= xcell[31];\nyanimals[3]= ycell[31];\nxanimals[4]= xcell[1];\nyanimals[4]= ycell[1];\n\n//2nd atom personal  right\nxanimals2[2]= xcell2[2];\nyanimals2[2]= ycell2[2];\nxanimals2[3]= xcell2[4];\nyanimals2[3]= ycell2[4];\nxanimals2[4]= xcell2[12];\nyanimals2[4]= ycell2[12];\nxanimals2[5]= xcell2[14];\nyanimals2[5]= ycell2[14];\n\n//3 atom personal  left\nxanimals3[2]= xcell3[31];\nyanimals3[2]= ycell3[31];\nxanimals3[3]= xcell3[1];\nyanimals3[3]= ycell3[1];\nxanimals3[4]= xcell3[25];\nyanimals3[4]= ycell3[25];\nxanimals3[5]= xcell3[23];\nyanimals3[5]= ycell3[23];\nxanimals3[1]= xcell3[17];\nyanimals3[1]= ycell3[17];\n\n//foreign e\nxanimals4[0]= xcell3[15];\nyanimals4[0]= ycell3[15];\n  instantchecking ();\n  _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n}\n\nelse if (question==11){ //NH3\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared R\nxanimals[0]= xcell[7];\nyanimals[0]= ycell[7];\nxanimals[1]= xcell[15];\nyanimals[1]= ycell[15];\nxanimals[2]= xcell[24];\nyanimals[2]= ycell[24];\nxanimals2[0]= xcell2[22]; //instead of 24\nyanimals2[0]= ycell2[22];\nxanimals3[0]= xcell3[5];\nyanimals3[0]= ycell3[5];\nxanimals4[0]= xcell4[0]; //instead of 31\nyanimals4[0]= ycell4[0];\n\n\n//1st atom personal \nxanimals[3]= xcell[31];\nyanimals[3]= ycell[31];\nxanimals[4]= xcell[1];\nyanimals[4]= ycell[1];\n  instantchecking ();\n  _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n}\n\nelse if (question==12){ //NH3\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared R\nxanimals[0]= xcell[7];\nyanimals[0]= ycell[7];\nxanimals[1]= xcell[15];\nyanimals[1]= ycell[15];\nxanimals[2]= xcell[24];\nyanimals[2]= ycell[24];\nxanimals[3]= xcell[1];\nyanimals[3]= ycell[1];\nxanimals2[0]= xcell2[22]; //instead of 24\nyanimals2[0]= ycell2[22];\nxanimals3[0]= xcell3[5];\nyanimals3[0]= ycell3[5];\nxanimals4[0]= xcell4[0]; //instead of 31\nyanimals4[0]= ycell4[0];\nxanimals5[0]= xcell5[13]; //instead of 31\nyanimals5[0]= ycell5[13];\n instantchecking ();\n _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n\n}\n\nelse if (question==13){ //CO3-2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared top\nxanimals[0]= xcell[30];\nyanimals[0]= ycell[30];\nxanimals[1]= xcell[0];\nyanimals[1]= ycell[0];\n//shared R\nxanimals[2]= xcell[9];\nyanimals[2]= ycell[9];\n//shared L\nxanimals[3]= xcell[21]; //instead of 24\nyanimals[3]= ycell[21];\n\n\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\nxanimals3[0]= xcell3[4];\nyanimals3[0]= ycell3[4];\n//shared top\nxanimals4[0]= xcell4[13]; //instead of 31\nyanimals4[0]= ycell4[13];\nxanimals4[1]= xcell4[15]; //instead of 31\nyanimals4[1]= ycell4[15];\n\n//2 personal\nxanimals2[1]= xcell2[3];\nyanimals2[1]= ycell2[3];\nxanimals2[2]= xcell2[5];\nyanimals2[2]= ycell2[5];\nxanimals2[3]= xcell2[10];\nyanimals2[3]= ycell2[10];\nxanimals2[4]= xcell2[12];\nyanimals2[4]= ycell2[12];\nxanimals2[5]= xcell2[18];\nyanimals2[5]= ycell2[18];\nxanimals5[0]= xcell2[20]; //foriegn\nyanimals5[0]= ycell2[20];\n\n//3 personal\nxanimals5[1]= xcell3[12]; //foriegn\nyanimals5[1]= ycell3[12];\nxanimals3[1]= xcell3[14];\nyanimals3[1]= ycell3[14];\nxanimals3[2]= xcell3[20];\nyanimals3[2]= ycell3[20];\nxanimals3[3]= xcell3[22];\nyanimals3[3]= ycell3[22];\nxanimals3[4]= xcell3[28];\nyanimals3[4]= ycell3[28];\nxanimals3[5]= xcell3[30];\nyanimals3[5]= ycell3[30];\n\n//4 atom personal \nxanimals4[2]= xcell4[26]; \nyanimals4[2]= ycell4[26];\nxanimals4[3]= xcell4[28]; \nyanimals4[3]= ycell4[28];\nxanimals4[4]= xcell4[4]; \nyanimals4[4]= ycell4[4];\nxanimals4[5]= xcell4[6]; \nyanimals4[5]= ycell4[6];\n  instantchecking ();\n  _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n}\n\nelse if (question==14){ //H2O2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared R\nxanimals[0]= xcell[6];\nyanimals[0]= ycell[6];\n\nxanimals2[0]= xcell2[6];\nyanimals2[0]= ycell2[6];\n\n//shared L\nxanimals[1]= xcell[22];\nyanimals[1]= ycell[22];\nxanimals2[1]= xcell2[23];\nyanimals2[1]= ycell2[23];\n\nxanimals3[0]= xcell3[6];\nyanimals3[0]= ycell3[6];\nxanimals4[0]= xcell4[22];\nyanimals4[0]= ycell4[22];\n\n//1st atom personal \nxanimals[2]= xcell[31];\nyanimals[2]= ycell[31];\nxanimals[3]= xcell[1];\nyanimals[3]= ycell[1];\nxanimals[4]= xcell[15];\nyanimals[4]= ycell[15];\nxanimals[5]= xcell[17];\nyanimals[5]= ycell[17];\n\n//2nd atom personal  right\nxanimals2[2]= xcell2[31];\nyanimals2[2]= ycell2[31];\nxanimals2[3]= xcell2[1];\nyanimals2[3]= ycell2[1];\nxanimals2[4]= xcell2[15];\nyanimals2[4]= ycell2[15];\nxanimals2[5]= xcell2[17];\nyanimals2[5]= ycell2[17];\n  instantchecking ();\n  _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n\n\n}\n\nelse if (question==15){ //SO3-2\nEJSS_INTERFACE.BoxPanel.showOkCancelDialog(\"\u26a0\ufe0fWarning! Your work will be erased and the recommended answer will be shown. Proceed or Cancel?\", \n    function(){ \n//shared top\nxanimals[0]= xcell[30];\nyanimals[0]= ycell[30];\nxanimals[1]= xcell[0];\nyanimals[1]= ycell[0];\n//shared R\nxanimals[2]= xcell[9];\nyanimals[2]= ycell[9];\n//shared L\nxanimals[3]= xcell[21]; //instead of 24\nyanimals[3]= ycell[21];\n\n\nxanimals2[0]= xcell2[26];\nyanimals2[0]= ycell2[26];\nxanimals3[0]= xcell3[4];\nyanimals3[0]= ycell3[4];\n//shared top\nxanimals4[0]= xcell4[13]; //instead of 31\nyanimals4[0]= ycell4[13];\nxanimals4[1]= xcell4[15]; //instead of 31\nyanimals4[1]= ycell4[15];\n// 1 personal\nxanimals[4]= xcell[5]; // yih check request\nyanimals[4]= ycell[5];\nxanimals[5]= xcell[6];\nyanimals[5]= ycell[6];\n\n//2 personal\nxanimals2[1]= xcell2[3];\nyanimals2[1]= ycell2[3];\nxanimals2[2]= xcell2[5];\nyanimals2[2]= ycell2[5];\nxanimals2[3]= xcell2[10];\nyanimals2[3]= ycell2[10];\nxanimals2[4]= xcell2[12];\nyanimals2[4]= ycell2[12];\nxanimals2[5]= xcell2[18];\nyanimals2[5]= ycell2[18];\nxanimals5[0]= xcell2[20]; //foriegn\nyanimals5[0]= ycell2[20];\n\n//3 personal\nxanimals5[1]= xcell3[12]; //foriegn\nyanimals5[1]= ycell3[12];\nxanimals3[1]= xcell3[14];\nyanimals3[1]= ycell3[14];\nxanimals3[2]= xcell3[20];\nyanimals3[2]= ycell3[20];\nxanimals3[3]= xcell3[22];\nyanimals3[3]= ycell3[22];\nxanimals3[4]= xcell3[28];\nyanimals3[4]= ycell3[28];\nxanimals3[5]= xcell3[30];\nyanimals3[5]= ycell3[30];\n\n//4 atom personal \nxanimals4[2]= xcell4[26]; \nyanimals4[2]= ycell4[26];\nxanimals4[3]= xcell4[28]; \nyanimals4[3]= ycell4[28];\nxanimals4[4]= xcell4[4]; \nyanimals4[4]= ycell4[4];\nxanimals4[5]= xcell4[6]; \nyanimals4[5]= ycell4[6];\n  instantchecking ();\n  _update(); // to force update view\n    },\n    function(){ \n     // alert(\"cancel\"); \n    });\n\n\n}\n\n\n\n\n\ntryshowanswer=true;\n//catch all\n/*\nif (tryshowanswer==true){\n  _tools.showOkDialog(\"Please drag the electrons and drop them again to check your undersatnding before checking/gaming \ud83e\udd14icon.\",\n   function(){ \n  tryshowanswer=false; //after \n  \n   _update(); // to force update view\n    });\n}\n*/\n// didnt work if put here  instantchecking (); must put inside function\n//instantchecking (); // put here also in addition to fixed relations\n//_update(); // to force update view\n//_play();"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal 2vw\""
                          }
                        ]
                      },
                      {
                        "Name": "resetButton",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Tooltip",
                            "value": "\"Reset\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Reset \u21bb\""
                          },
                          {
                            "name": "Width",
                            "value": "\"20vw\""
                          },
                          {
                            "name": "OnClick",
                            "value": "returnelectron1 ();\nlayelectrons (); //return all back to original position\n\n\n//_reset();\n"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal 2vw \""
                          }
                        ]
                      },
                      {
                        "Name": "audio",
                        "Type": "Audio",
                        "Properties": [
                          {
                            "name": "AudioUrl",
                            "value": "\"./polyatomicions/Ding Sound Effect.m4a\""
                          }
                        ]
                      },
                      {
                        "Name": "debug",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"debug\""
                          },
                          {
                            "name": "OnClick",
                            "value": "instantchecking ();"
                          },
                          {
                            "name": "Display",
                            "value": "\"none\""
                          }
                        ]
                      },
                      {
                        "Name": "audio2",
                        "Type": "Audio",
                        "Properties": [
                          {
                            "name": "AudioUrl",
                            "value": "\"./polyatomicions/Wrong-answer-sound-effect.mp3\""
                          }
                        ]
                      },
                      {
                        "Name": "audioclap",
                        "Type": "Audio",
                        "Properties": [
                          {
                            "name": "AudioUrl",
                            "value": "\"./polyatomicions/applause2.mp3\""
                          }
                        ]
                      },
                      {
                        "Name": "audiowhistle",
                        "Type": "Audio",
                        "Properties": [
                          {
                            "name": "AudioUrl",
                            "value": "\"./polyatomicions/Whistling-Call-A1-www.fesliyanstudios.com.mp3\""
                          }
                        ]
                      },
                      {
                        "Name": "audiotada",
                        "Type": "Audio",
                        "Properties": [
                          {
                            "name": "AudioUrl",
                            "value": "\"./polyatomicions/Tada-sound.mp3\""
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "Name": "plottingPanel",
            "Type": "PlottingPanel",
            "Expanded": "false",
            "Properties": [
              {
                "name": "ShowAreaRectangle",
                "value": "false"
              },
              {
                "name": "Gutters",
                "value": "[0,0,0,0]"
              },
              {
                "name": "YScalePrecision",
                "value": "0"
              },
              {
                "name": "XFixedTick",
                "value": "xmin"
              },
              {
                "name": "OnDoubleClick",
                "value": "toggleFullScreen();"
              },
              {
                "name": "YFixedTick",
                "value": "ymin"
              },
              {
                "name": "TRMessage",
                "value": "\"Score = \"+score+\" /14\""
              },
              {
                "name": "XTickStep",
                "value": "xmax-xmin"
              },
              {
                "name": "YTickStep",
                "value": "ymax-ymin"
              },
              {
                "name": "XAutoTicks",
                "value": "false"
              },
              {
                "name": "Height",
                "value": "%changeOrientation()%"
              },
              {
                "name": "Width",
                "value": "\"100%\""
              },
              {
                "name": "TLMessage",
                "value": "debug?\"occupied=\"+occupied+\"\\noccupied2=\"+occupied2+\"\\noccupied3=\"+occupied3+\"\\noccupied4=\"+occupied4+\"\\noccupied5=\"+occupied5:\"\""
              },
              {
                "name": "Enabled",
                "value": "true"
              },
              {
                "name": "SquareAspect",
                "value": "true"
              },
              {
                "name": "MaximumY",
                "value": "ymax"
              },
              {
                "name": "MaximumX",
                "value": "xmax"
              },
              {
                "name": "YAutoTicks",
                "value": "false"
              },
              {
                "name": "MinimumX",
                "value": "xmin"
              },
              {
                "name": "MinimumY",
                "value": "ymin"
              },
              {
                "name": "AutoScaleY",
                "value": "false"
              },
              {
                "name": "AutoScaleX",
                "value": "false"
              },
              {
                "name": "MarginY",
                "value": "10"
              },
              {
                "name": "XScalePrecision",
                "value": "0"
              },
              {
                "name": "BLMessage",
                "value": "debug?\"sumsharede=\"+sumsharede+\"\\nsumsharede2=\"+sumsharede2+\"\\nsumsharede3=\"+sumsharede3+\"\\nsumsharede4=\"+sumsharede4+\"\\nsumsharede5=\"+sumsharede5+\"\\nsumsharede6=\"+sumsharede6+\"\\nsumsharede7=\"+sumsharede7+\"\\nsumsharede8=\"+sumsharede8+\"\\nsumpersonale=\"+sumpersonale+\"\\nsumpersonale2=\"+sumpersonale2+\"\\nsumpersonale3=\"+sumpersonale3+\"\\nsumpersonale4=\"+sumpersonale4+\"\\nsumpersonale5=\"+sumpersonale5:\"\""
              },
              {
                "name": "BRMessage",
                "value": "trmessage"
              }
            ],
            "Children": [
              {
                "Name": "firstatomoxygen",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [],
                "Children": [
                  {
                    "Name": "circle",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "radius1*2"
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"ELLIPSE\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"Black\""
                      },
                      {
                        "name": "Y",
                        "value": "ycentre"
                      },
                      {
                        "name": "Visibility",
                        "value": "question!=15"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius1*2"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "DrawFill",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "shapeSetplaceholder",
                    "Type": "ShapeSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n"
                      },
                      {
                        "name": "FillColor",
                        "value": "color1"
                      },
                      {
                        "name": "SizeX",
                        "value": "tol/20"
                      },
                      {
                        "name": "X",
                        "value": "xcell"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"White\""
                      },
                      {
                        "name": "Y",
                        "value": "ycell"
                      },
                      {
                        "name": "SizeY",
                        "value": "tol/20"
                      },
                      {
                        "name": "PixelSize",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "textobject2",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"Black\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"EAST\""
                      },
                      {
                        "name": "X",
                        "value": "xcell"
                      },
                      {
                        "name": "Y",
                        "value": "ycell"
                      },
                      {
                        "name": "Text",
                        "value": "textanswer"
                      },
                      {
                        "name": "Visibility",
                        "value": "debug"
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 10px \""
                      }
                    ]
                  },
                  {
                    "Name": "symbol",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color1"
                      },
                      {
                        "name": "X",
                        "value": "xcentre"
                      },
                      {
                        "name": "Y",
                        "value": "ycentre"
                      },
                      {
                        "name": "Text",
                        "value": "symbol"
                      },
                      {
                        "name": "Font",
                        "value": "fontsymbol"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "secondatomhydrogen",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [],
                "Children": [
                  {
                    "Name": "circle2",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "radius2*2"
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"ELLIPSE\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre2"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"Black\""
                      },
                      {
                        "name": "Y",
                        "value": "ycentre2"
                      },
                      {
                        "name": "Visibility",
                        "value": "question!=15"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius2*2"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "DrawFill",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "shapeSetplaceholder2",
                    "Type": "ShapeSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n2"
                      },
                      {
                        "name": "FillColor",
                        "value": "color2"
                      },
                      {
                        "name": "SizeX",
                        "value": "tol/20"
                      },
                      {
                        "name": "X",
                        "value": "xcell2"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"White\""
                      },
                      {
                        "name": "Y",
                        "value": "ycell2"
                      },
                      {
                        "name": "SizeY",
                        "value": "tol/20"
                      },
                      {
                        "name": "PixelSize",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "textobject22",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n2"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"Green\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"WEST\""
                      },
                      {
                        "name": "X",
                        "value": "xcell2"
                      },
                      {
                        "name": "Y",
                        "value": "ycell2"
                      },
                      {
                        "name": "Text",
                        "value": "textanswer2"
                      },
                      {
                        "name": "Visibility",
                        "value": "debug"
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 10px \""
                      }
                    ]
                  },
                  {
                    "Name": "symbol2",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color2"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2"
                      },
                      {
                        "name": "Y",
                        "value": "ycentre2"
                      },
                      {
                        "name": "Text",
                        "value": "symbol2"
                      },
                      {
                        "name": "Font",
                        "value": "fontsymbol"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "thirdatom",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question>7"
                  }
                ],
                "Children": [
                  {
                    "Name": "circle22",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "radius3*2"
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"ELLIPSE\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre3"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"Black\""
                      },
                      {
                        "name": "Y",
                        "value": "ycentre3"
                      },
                      {
                        "name": "Visibility",
                        "value": "question!=15"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius3*2"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "DrawFill",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "shapeSetplaceholder22",
                    "Type": "ShapeSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n3"
                      },
                      {
                        "name": "FillColor",
                        "value": "color3"
                      },
                      {
                        "name": "SizeX",
                        "value": "tol/20"
                      },
                      {
                        "name": "X",
                        "value": "xcell3"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"White\""
                      },
                      {
                        "name": "Y",
                        "value": "ycell3"
                      },
                      {
                        "name": "SizeY",
                        "value": "tol/20"
                      },
                      {
                        "name": "PixelSize",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "textobject222",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n3"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"Orange\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"NORTH\""
                      },
                      {
                        "name": "X",
                        "value": "xcell3"
                      },
                      {
                        "name": "Y",
                        "value": "ycell3"
                      },
                      {
                        "name": "Text",
                        "value": "textanswer3"
                      },
                      {
                        "name": "Visibility",
                        "value": "debug"
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 10px \""
                      }
                    ]
                  },
                  {
                    "Name": "symbol22",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color3"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3"
                      },
                      {
                        "name": "Y",
                        "value": "ycentre3"
                      },
                      {
                        "name": "Text",
                        "value": "symbol3"
                      },
                      {
                        "name": "Font",
                        "value": "fontsymbol"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "fourthatom2",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question>=11"
                  }
                ],
                "Children": [
                  {
                    "Name": "circle222",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "radius4*2"
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"ELLIPSE\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre4"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"Black\""
                      },
                      {
                        "name": "Y",
                        "value": "ycentre4"
                      },
                      {
                        "name": "Visibility",
                        "value": "question!=15"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius4*2"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "DrawFill",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "shapeSetplaceholder222",
                    "Type": "ShapeSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n4"
                      },
                      {
                        "name": "FillColor",
                        "value": "color4"
                      },
                      {
                        "name": "SizeX",
                        "value": "tol/20"
                      },
                      {
                        "name": "X",
                        "value": "xcell4"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"White\""
                      },
                      {
                        "name": "Y",
                        "value": "ycell4"
                      },
                      {
                        "name": "SizeY",
                        "value": "tol/20"
                      },
                      {
                        "name": "PixelSize",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "textobject2222",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n4"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"Red\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"NORTH\""
                      },
                      {
                        "name": "X",
                        "value": "xcell4"
                      },
                      {
                        "name": "Y",
                        "value": "ycell4"
                      },
                      {
                        "name": "Text",
                        "value": "textanswer4"
                      },
                      {
                        "name": "Visibility",
                        "value": "debug"
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 10px \""
                      }
                    ]
                  },
                  {
                    "Name": "symbol222",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color4"
                      },
                      {
                        "name": "X",
                        "value": "xcentre4"
                      },
                      {
                        "name": "Y",
                        "value": "ycentre4"
                      },
                      {
                        "name": "Text",
                        "value": "symbol4"
                      },
                      {
                        "name": "Font",
                        "value": "fontsymbol"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "fifthatom22",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==12"
                  }
                ],
                "Children": [
                  {
                    "Name": "circle2222",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "radius5*2"
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"ELLIPSE\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre5"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"Black\""
                      },
                      {
                        "name": "Y",
                        "value": "ycentre5"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius5*2"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "DrawFill",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "shapeSetplaceholder2222",
                    "Type": "ShapeSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n5"
                      },
                      {
                        "name": "FillColor",
                        "value": "color5"
                      },
                      {
                        "name": "SizeX",
                        "value": "tol/20"
                      },
                      {
                        "name": "X",
                        "value": "xcell5"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"White\""
                      },
                      {
                        "name": "Y",
                        "value": "ycell5"
                      },
                      {
                        "name": "SizeY",
                        "value": "tol/20"
                      },
                      {
                        "name": "PixelSize",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "textobject22222",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "NumberOfElements",
                        "value": "n5"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"Red\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"NORTH\""
                      },
                      {
                        "name": "X",
                        "value": "xcell5"
                      },
                      {
                        "name": "Y",
                        "value": "ycell5"
                      },
                      {
                        "name": "Text",
                        "value": "textanswer5"
                      },
                      {
                        "name": "Visibility",
                        "value": "debug"
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 10px \""
                      }
                    ]
                  },
                  {
                    "Name": "symbol2222",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre5"
                      },
                      {
                        "name": "Y",
                        "value": "ycentre5"
                      },
                      {
                        "name": "Text",
                        "value": "symbol5"
                      },
                      {
                        "name": "Font",
                        "value": "fontsymbol"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "bracketsq7n6",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==7||question==6"
                  }
                ],
                "Children": [
                  {
                    "Name": "topleft",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "(radius1*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "segment_L",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "X",
                        "value": "xcentre-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "0"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius1*2+0.5"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"CENTERED\""
                      }
                    ]
                  },
                  {
                    "Name": "botleft2",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-(radius1*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "segment_2R",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "0"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius2*2+0.5"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"CENTERED\""
                      }
                    ]
                  },
                  {
                    "Name": "topright",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "-0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "(radius2*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "botright2",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "-0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-(radius2*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "negative",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "RelativePosition",
                        "value": "\"NORTH_WEST\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.6"
                      },
                      {
                        "name": "Y",
                        "value": "(radius2*2+1)/2"
                      },
                      {
                        "name": "Text",
                        "value": "\"-\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 5vw \""
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "bracketsq10",
                "Type": "Group2D",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==10"
                  }
                ],
                "Children": [
                  {
                    "Name": "topleft2",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "(radius3*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "segment_L2",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "0"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius3*2+0.5"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"CENTERED\""
                      }
                    ]
                  },
                  {
                    "Name": "botleft22",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-(radius3*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "segment_2R2",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "0"
                      },
                      {
                        "name": "SizeY",
                        "value": "radius2*2+0.5"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"CENTERED\""
                      }
                    ]
                  },
                  {
                    "Name": "topright2",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "-0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "(radius2*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "botright22",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "-0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-(radius2*2+0.5)/2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "negative2",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "RelativePosition",
                        "value": "\"NORTH_WEST\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.6"
                      },
                      {
                        "name": "Y",
                        "value": "(radius2*2+1)/2"
                      },
                      {
                        "name": "Text",
                        "value": "\"-\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 5vw \""
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "bracketsq13n15",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==13||question==15"
                  }
                ],
                "Children": [
                  {
                    "Name": "topleft22",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "2.4"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "segment_L22",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-2"
                      },
                      {
                        "name": "SizeY",
                        "value": "4.4"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "botleft222",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre3-radius1-0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "segment_2R22",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-2"
                      },
                      {
                        "name": "SizeY",
                        "value": "4.4"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "topright22",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "-0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "2.4"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "botright222",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "SizeX",
                        "value": "-0.5"
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.5"
                      },
                      {
                        "name": "Y",
                        "value": "-2"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "LineWidth",
                        "value": "4"
                      },
                      {
                        "name": "Offset",
                        "value": "\"SOUTH_WEST\""
                      }
                    ]
                  },
                  {
                    "Name": "negative22",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "RelativePosition",
                        "value": "\"SOUTH_WEST\""
                      },
                      {
                        "name": "X",
                        "value": "xcentre2+radius2+0.6"
                      },
                      {
                        "name": "Y",
                        "value": "2.4"
                      },
                      {
                        "name": "Text",
                        "value": "\"  2-\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal normal 2vw \""
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "words1",
                "Type": "Text2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color1"
                  },
                  {
                    "name": "RelativePosition",
                    "value": "\"EAST\""
                  },
                  {
                    "name": "X",
                    "value": "-0.5"
                  },
                  {
                    "name": "Y",
                    "value": "yspace[0]"
                  },
                  {
                    "name": "Text",
                    "value": "text1"
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal 2vw \""
                  }
                ]
              },
              {
                "Name": "words2",
                "Type": "Text2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color2"
                  },
                  {
                    "name": "RelativePosition",
                    "value": "\"EAST\""
                  },
                  {
                    "name": "X",
                    "value": "-0.5"
                  },
                  {
                    "name": "Y",
                    "value": "yspace[1]"
                  },
                  {
                    "name": "Text",
                    "value": "text2"
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal 2vw \""
                  }
                ]
              },
              {
                "Name": "words3",
                "Type": "Text2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color3"
                  },
                  {
                    "name": "RelativePosition",
                    "value": "\"EAST\""
                  },
                  {
                    "name": "X",
                    "value": "-0.5"
                  },
                  {
                    "name": "Y",
                    "value": "yspace[2]"
                  },
                  {
                    "name": "Text",
                    "value": "text3"
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal 2vw \""
                  }
                ]
              },
              {
                "Name": "words4",
                "Type": "Text2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color4"
                  },
                  {
                    "name": "RelativePosition",
                    "value": "\"EAST\""
                  },
                  {
                    "name": "X",
                    "value": "-0.5"
                  },
                  {
                    "name": "Y",
                    "value": "yspace[3]"
                  },
                  {
                    "name": "Text",
                    "value": "text4"
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal 2vw \""
                  }
                ]
              },
              {
                "Name": "words5",
                "Type": "Text2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color5"
                  },
                  {
                    "name": "RelativePosition",
                    "value": "\"EAST\""
                  },
                  {
                    "name": "X",
                    "value": "-0.5"
                  },
                  {
                    "name": "Y",
                    "value": "yspace[4]"
                  },
                  {
                    "name": "Text",
                    "value": "text5"
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal 2vw \""
                  }
                ]
              },
              {
                "Name": "first_textobjectelectronson1atom",
                "Type": "TextSet2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color1"
                  },
                  {
                    "name": "Text",
                    "value": "textobject"
                  },
                  {
                    "name": "Font",
                    "value": "font1"
                  },
                  {
                    "name": "OnDrag",
                    "value": "//duplcate stable\n//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//1 electrons on 1st rowelectrons\nfor (var i=0; i<objectinteracted ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals[i];\nvar dy = yanimals[objectinteracted] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter[i]/2)&&nanimalsshow==true) {\n angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals[i], xanimals[objectinteracted] - xanimals[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n   // collision detected!\n}\n}\n// cannot self check ==objectinteracted\nfor (var i=objectinteracted+1; i<nanimals ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals[i];\nvar dy = yanimals[objectinteracted] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter[i]/2)&&nanimalsshow==true) {\nangleRadians = Math.atan2(yanimals[objectinteracted] - yanimals[i], xanimals[objectinteracted] - xanimals[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n//1row electrons on 2nd rowelectrons\nfor (var i=0; i<nanimals2 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals2[i];\nvar dy = yanimals[objectinteracted] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n  angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals2[i], xanimals[objectinteracted] - xanimals2[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n//1row electrons on 3nd rowelectrons\nfor (var i=0; i<nanimals3 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals3[i];\nvar dy = yanimals[objectinteracted] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals3[i], xanimals[objectinteracted] - xanimals3[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n}\n\n}\n\n//1row electrons on 4 rowelectrons\nfor (var i=0; i<nanimals4 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals4[i];\nvar dy = yanimals[objectinteracted] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals4[i], xanimals[objectinteracted] - xanimals4[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n//1row electrons on 5th rowelectrons\nfor (var i=0; i<nanimals5 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals5[i];\nvar dy = yanimals[objectinteracted] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals5[i], xanimals[objectinteracted] - xanimals5[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n"
                  },
                  {
                    "name": "ElementInteracted",
                    "value": "objectinteracted"
                  },
                  {
                    "name": "NumberOfElements",
                    "value": "nanimals"
                  },
                  {
                    "name": "OnRelease",
                    "value": "\n\n\n//if (occupied[0]==false){\n if ((Math.abs(xanimals[objectinteracted]-xcell[0])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[0])<tol/2)&&occupied[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[0]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[0]\n \n  occupied[0]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[1])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[1])<tol/2)&&occupied[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[1]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[1]\n occupied[1]=1; // to prevent same cell used again by another like a first time\n enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals[objectinteracted]-xcell[2])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[2])<tol/2)&&occupied[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[2]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[2]\n  occupied[2]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[3])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[3])<tol/2)&&occupied[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[3]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[3]\n  occupied[3]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[4])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[4])<tol/2)&&occupied[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[4]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[4]\n  occupied[4]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[5])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[5])<tol/2)&&occupied[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[5]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[5]\n  occupied[5]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[6])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[6])<tol/2)&&occupied[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[6]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[6]\n  occupied[6]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[7])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[7])<tol/2)&&occupied[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[7]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[7]\n  occupied[7]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[8])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[8])<tol/2)&&occupied[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[8]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[8]\n  occupied[8]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[9])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[9])<tol/2)&&occupied[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[9]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[9]\n  occupied[9]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[10])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[10])<tol/2)&&occupied[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[10]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[10]\n \n  occupied[10]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[11])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[11])<tol/2)&&occupied[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[11]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[11]\n occupied[11]=1; // to prevent same cell used again by another like a first time\n enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals[objectinteracted]-xcell[12])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[12])<tol/2)&&occupied[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[12]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[12]\n  occupied[12]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[13])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[13])<tol/2)&&occupied[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[13]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[13]\n  occupied[13]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[14])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[14])<tol/2)&&occupied[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[14]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[14]\n  occupied[14]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[15])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[15])<tol/2)&&occupied[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[15]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[15]\n  occupied[15]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[16])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[16])<tol/2)&&occupied[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[16]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[16]\n  occupied[16]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[17])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[17])<tol/2)&&occupied[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[17]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[17]\n  occupied[17]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[18])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[18])<tol/2)&&occupied[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[18]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[18]\n  occupied[18]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[19])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[19])<tol/2)&&occupied[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[19]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[19]\n  occupied[19]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[20])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[20])<tol/2)&&occupied[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[20]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[20]\n \n  occupied[20]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[21])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[21])<tol/2)&&occupied[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[21]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[21]\n occupied[21]=1; // to prevent same cell used again by another like a first time\n enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals[objectinteracted]-xcell[22])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[22])<tol/2)&&occupied[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[22]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[22]\n  occupied[22]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[23])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[23])<tol/2)&&occupied[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[23]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[23]\n  occupied[23]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[24])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[24])<tol/2)&&occupied[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[24]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[24]\n  occupied[24]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[25])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[25])<tol/2)&&occupied[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[25]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[25]\n  occupied[25]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[26])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[26])<tol/2)&&occupied[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[26]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[26]\n  occupied[26]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[27])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[27])<tol/2)&&occupied[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[27]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[27]\n  occupied[27]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[28])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[28])<tol/2)&&occupied[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[28]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[28]\n  occupied[28]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[29])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[29])<tol/2)&&occupied[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[29]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[29]\n  occupied[29]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[30])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[30])<tol/2)&&occupied[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[30]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[30]\n \n  occupied[30]=1; // to prevent same cell used again by another like a first time\n  enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[31])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[31])<tol/2)&&occupied[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[31]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[31]\n occupied[31]=1; // to prevent same cell used again by another like a first time\n enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n  yanimals[objectinteracted]=yanimalss[objectinteracted];\n  }\n\ninstantanswer ();"
                  },
                  {
                    "name": "Sensitivity",
                    "value": "sensitivity"
                  },
                  {
                    "name": "X",
                    "value": "xanimals"
                  },
                  {
                    "name": "OnEnter",
                    "value": "objectinteracted=objectinteracted;"
                  },
                  {
                    "name": "Y",
                    "value": "yanimals"
                  },
                  {
                    "name": "Visibility",
                    "value": "false"
                  },
                  {
                    "name": "EnabledPosition",
                    "value": "enabledposition"
                  }
                ]
              },
              {
                "Name": "first2",
                "Type": "ShapeSet2D",
                "Properties": [
                  {
                    "name": "NumberOfElements",
                    "value": "nanimals"
                  },
                  {
                    "name": "FillColor",
                    "value": "color1"
                  },
                  {
                    "name": "Sensitivity",
                    "value": "sensitivity"
                  },
                  {
                    "name": "SizeX",
                    "value": "0.15"
                  },
                  {
                    "name": "ShapeType",
                    "value": "\"ELLIPSE\""
                  },
                  {
                    "name": "X",
                    "value": "xanimals"
                  },
                  {
                    "name": "Y",
                    "value": "yanimals"
                  },
                  {
                    "name": "SizeY",
                    "value": "0.15"
                  },
                  {
                    "name": "EnabledPosition",
                    "value": "enabledposition"
                  },
                  {
                    "name": "ElementInteracted",
                    "value": "objectinteracted"
                  }
                ]
              },
              {
                "Name": "first",
                "Type": "ShapeSet2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "\"url(#mygrandient1)\""
                  },
                  {
                    "name": "ShapeType",
                    "value": "\"ELLIPSE\""
                  },
                  {
                    "name": "OnDrag",
                    "value": "//duplicate code to increase stable behavoir\n//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//1 electrons on 1st rowelectrons\nfor (var i=0; i<objectinteracted ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals[i];\nvar dy = yanimals[objectinteracted] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter[i]/2)&&nanimalsshow==true) {\n angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals[i], xanimals[objectinteracted] - xanimals[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n   // collision detected!\n}\n}\n// cannot self check ==objectinteracted\nfor (var i=objectinteracted+1; i<=nanimals ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals[i];\nvar dy = yanimals[objectinteracted] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter[i]/2)&&nanimalsshow==true) {\nangleRadians = Math.atan2(yanimals[objectinteracted] - yanimals[i], xanimals[objectinteracted] - xanimals[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n//1row electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals2[i];\nvar dy = yanimals[objectinteracted] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n  angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals2[i], xanimals[objectinteracted] - xanimals2[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n//1row electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals3[i];\nvar dy = yanimals[objectinteracted] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals3[i], xanimals[objectinteracted] - xanimals3[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n}\n\n}\n\n//1row electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals4[i];\nvar dy = yanimals[objectinteracted] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals4[i], xanimals[objectinteracted] - xanimals4[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n//1row electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals[objectinteracted] - xanimals5[i];\nvar dy = yanimals[objectinteracted] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter[objectinteracted]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals[objectinteracted] - yanimals5[i], xanimals[objectinteracted] - xanimals5[i]);\nvar spacing=0.1;\nxanimals[objectinteracted]= xanimals[objectinteracted]+Math.cos(angleRadians)*spacing;\nyanimals[objectinteracted]= yanimals[objectinteracted]+Math.sin(angleRadians)*spacing;\n\n    // collision detected!\n}\n}\n\n"
                  },
                  {
                    "name": "ElementInteracted",
                    "value": "objectinteracted"
                  },
                  {
                    "name": "NumberOfElements",
                    "value": "nanimals"
                  },
                  {
                    "name": "OnRelease",
                    "value": "\n\n\n//if (occupied[0]==false){\n if ((Math.abs(xanimals[objectinteracted]-xcell[0])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[0])<tol/2)&&occupied[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[0]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[0];\n \n  //occupied[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[1])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[1])<tol/2)&&occupied[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[1]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[1]\n //occupied[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals[objectinteracted]-xcell[2])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[2])<tol/2)&&occupied[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[2]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[2]\n // occupied[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[3])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[3])<tol/2)&&occupied[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[3]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[3]\n  //occupied[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[4])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[4])<tol/2)&&occupied[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[4]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[4]\n // occupied[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[5])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[5])<tol/2)&&occupied[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[5]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[5]\n // occupied[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[6])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[6])<tol/2)&&occupied[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[6]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[6]\n  //occupied[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[7])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[7])<tol/2)&&occupied[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[7]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[7]\n // occupied[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[8])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[8])<tol/2)&&occupied[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[8]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[8]\n // occupied[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[9])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[9])<tol/2)&&occupied[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[9]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[9]\n // occupied[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[10])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[10])<tol/2)&&occupied[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[10]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[10]\n \n // occupied[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[11])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[11])<tol/2)&&occupied[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[11]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[11]\n //occupied[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals[objectinteracted]-xcell[12])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[12])<tol/2)&&occupied[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[12]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[12]\n  //occupied[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[13])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[13])<tol/2)&&occupied[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[13]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[13]\n // occupied[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[14])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[14])<tol/2)&&occupied[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[14]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[14]\n  //occupied[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[15])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[15])<tol/2)&&occupied[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[15]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[15]\n  //occupied[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[16])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[16])<tol/2)&&occupied[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[16]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[16]\n // occupied[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[17])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[17])<tol/2)&&occupied[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[17]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[17]\n  //occupied[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[18])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[18])<tol/2)&&occupied[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[18]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[18]\n // occupied[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[19])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[19])<tol/2)&&occupied[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[19]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[19]\n // occupied[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[20])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[20])<tol/2)&&occupied[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[20]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[20]\n \n  //occupied[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[21])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[21])<tol/2)&&occupied[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[21]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[21]\n //occupied[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals[objectinteracted]-xcell[22])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[22])<tol/2)&&occupied[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[22]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[22]\n  //occupied[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[23])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[23])<tol/2)&&occupied[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[23]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[23]\n  //occupied[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[24])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[24])<tol/2)&&occupied[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[24]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[24]\n // occupied[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[25])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[25])<tol/2)&&occupied[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[25]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[25]\n  occupied[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[26])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[26])<tol/2)&&occupied[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[26]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[26]\n // occupied[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[27])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[27])<tol/2)&&occupied[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[27]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[27]\n//  occupied[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[28])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[28])<tol/2)&&occupied[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[28]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[28]\n // occupied[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[29])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[29])<tol/2)&&occupied[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[29]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[29]\n // occupied[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals[objectinteracted]-xcell[30])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[30])<tol/2)&&occupied[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[30]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[30]\n \n // occupied[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition[objectinteracted]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals[objectinteracted]-xcell[31])<tol/2)&&(Math.abs(yanimals[objectinteracted]-ycell[31])<tol/2)&&occupied[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals[objectinteracted]=xcell[31]; // for snapping to grid position\n   yanimals[objectinteracted]=ycell[31]\n //occupied[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition[objectinteracted]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n // yanimals[objectinteracted]=yanimalss[objectinteracted];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals[objectinteracted]=xanimalss[objectinteracted]; // return to stored values initially\n  yanimals[objectinteracted]=yanimalss[objectinteracted];\n  }\n\ninstantanswer ();\ninstantchecking ();\n\n"
                  },
                  {
                    "name": "Sensitivity",
                    "value": "sensitivity"
                  },
                  {
                    "name": "SizeX",
                    "value": "diameter"
                  },
                  {
                    "name": "X",
                    "value": "xanimals"
                  },
                  {
                    "name": "OnEnter",
                    "value": "objectinteracted=objectinteracted;"
                  },
                  {
                    "name": "Y",
                    "value": "yanimals"
                  },
                  {
                    "name": "OnPress",
                    "value": "returnelectron1 ();"
                  },
                  {
                    "name": "SizeY",
                    "value": "diameter"
                  },
                  {
                    "name": "EnabledPosition",
                    "value": "enabledposition"
                  }
                ]
              },
              {
                "Name": "second_textobject2electronson2atom",
                "Type": "TextSet2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color2"
                  },
                  {
                    "name": "Text",
                    "value": "textobject2"
                  },
                  {
                    "name": "Font",
                    "value": "font2"
                  },
                  {
                    "name": "OnDrag",
                    "value": "//extra duplicated code from fixed relationship  debug if it more stable\n\n//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//2 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals[i];\nvar dy = yanimals2[objectinteracted2] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter[i]/2)&&nanimalsshow==true) {\n    angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals[i], xanimals2[objectinteracted2] - xanimals[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n//2 electrons on 2nd rowelectrons\nfor (var i=0; i<objectinteracted2 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals2[i];\nvar dy = yanimals2[objectinteracted2] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals2[i], xanimals2[objectinteracted2] - xanimals2[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n//xanimals2[objectinteracted2]=xanimalss2[objectinteracted2]; //return to original position\n   //yanimals2[objectinteracted2]=yanimalss2[objectinteracted2]\n    // collision detected!\n}\n}\n//cannot self check\nfor (var i=objectinteracted2+1; i<=nanimals2 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals2[i];\nvar dy = yanimals2[objectinteracted2] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals2[i], xanimals2[objectinteracted2] - xanimals2[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n\n\n//2 electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals3[i];\nvar dy = yanimals2[objectinteracted2] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\nangleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals3[i], xanimals2[objectinteracted2] - xanimals3[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n\n}\n\n//2 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals4[i];\nvar dy = yanimals2[objectinteracted2] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals4[i], xanimals2[objectinteracted2] - xanimals4[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n//2 electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals5[i];\nvar dy = yanimals2[objectinteracted2] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals5[i], xanimals2[objectinteracted2] - xanimals5[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n"
                  },
                  {
                    "name": "ElementInteracted",
                    "value": "objectinteracted2"
                  },
                  {
                    "name": "NumberOfElements",
                    "value": "nanimals2"
                  },
                  {
                    "name": "OnRelease",
                    "value": "\n\n\n//if (occupied2[0]==false){\n if ((Math.abs(xanimals2[objectinteracted2]-xcell2[0])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[0])<tol/2)&&occupied2[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[0]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[0]\n \n // occupied2[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[1])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[1])<tol/2)&&occupied2[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[1]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[1]\n //occupied2[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[2])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[2])<tol/2)&&occupied2[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[2]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[2]\n//  occupied2[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[3])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[3])<tol/2)&&occupied2[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[3]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[3]\n // occupied2[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[4])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[4])<tol/2)&&occupied2[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[4]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[4]\n // occupied2[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[5])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[5])<tol/2)&&occupied2[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[5]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[5]\n // occupied2[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[6])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[6])<tol/2)&&occupied2[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[6]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[6]\n // occupied2[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[7])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[7])<tol/2)&&occupied2[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[7]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[7]\n // occupied2[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[8])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[8])<tol/2)&&occupied2[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[8]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[8]\n // occupied2[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[9])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[9])<tol/2)&&occupied2[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[9]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[9]\n // occupied2[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[10])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[10])<tol/2)&&occupied2[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[10]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[10]\n \n // occupied2[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[11])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[11])<tol/2)&&occupied2[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[11]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[11]\n //occupied2[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[12])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[12])<tol/2)&&occupied2[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[12]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[12]\n // occupied2[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[13])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[13])<tol/2)&&occupied2[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[13]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[13]\n // occupied2[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[14])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[14])<tol/2)&&occupied2[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[14]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[14]\n // occupied2[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[15])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[15])<tol/2)&&occupied2[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[15]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[15]\n // occupied2[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[16])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[16])<tol/2)&&occupied2[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[16]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[16]\n // occupied2[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[17])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[17])<tol/2)&&occupied2[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[17]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[17]\n // occupied2[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[18])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[18])<tol/2)&&occupied2[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[18]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[18]\n // occupied2[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[19])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[19])<tol/2)&&occupied2[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[19]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[19]\n // occupied2[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[20])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[20])<tol/2)&&occupied2[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[20]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[20]\n \n // occupied2[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[21])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[21])<tol/2)&&occupied2[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[21]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[21]\n //occupied2[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[22])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[22])<tol/2)&&occupied2[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[22]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[22]\n // occupied2[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[23])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[23])<tol/2)&&occupied2[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[23]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[23]\n // occupied2[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[24])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[24])<tol/2)&&occupied2[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[24]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[24]\n // occupied2[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[25])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[25])<tol/2)&&occupied2[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[25]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[25]\n // occupied2[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[26])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[26])<tol/2)&&occupied2[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[26]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[26]\n // occupied2[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[27])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[27])<tol/2)&&occupied2[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[27]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[27]\n // occupied2[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[28])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[28])<tol/2)&&occupied2[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[28]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[28]\n // occupied2[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[29])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[29])<tol/2)&&occupied2[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[29]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[29]\n // occupied2[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[30])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[30])<tol/2)&&occupied2[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[30]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[30]\n \n // occupied2[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimalss[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimalss[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[31]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[31])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[31])<tol/2)&&occupied2[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[31]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[31]\n //occupied2[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimalss[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimalss[objectinteracted2];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals2[objectinteracted2]=xanimalss2[objectinteracted2]; // return to stored values initially\n  yanimals2[objectinteracted2]=yanimalss2[objectinteracted2];\n  }\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n"
                  },
                  {
                    "name": "Sensitivity",
                    "value": "sensitivity"
                  },
                  {
                    "name": "X",
                    "value": "xanimals2"
                  },
                  {
                    "name": "OnEnter",
                    "value": "objectinteracted2=objectinteracted2;"
                  },
                  {
                    "name": "Y",
                    "value": "yanimals2"
                  },
                  {
                    "name": "OnPress",
                    "value": "returnelectron1 ();"
                  },
                  {
                    "name": "EnabledPosition",
                    "value": "enabledposition2"
                  }
                ]
              },
              {
                "Name": "second2",
                "Type": "ShapeSet2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "color2"
                  },
                  {
                    "name": "ShapeType",
                    "value": "\"ELLIPSE\""
                  },
                  {
                    "name": "ElementInteracted",
                    "value": "objectinteracted2"
                  },
                  {
                    "name": "NumberOfElements",
                    "value": "nanimals2"
                  },
                  {
                    "name": "OnRelease",
                    "value": "\n\n\n//if (occupied2[0]==false){\n if ((Math.abs(xanimals2[objectinteracted2]-xcell2[0])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[0])<tol/2)&&occupied2[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[0]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[0]\n \n  occupied2[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[1])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[1])<tol/2)&&occupied2[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[1]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[1]\n occupied2[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[2])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[2])<tol/2)&&occupied2[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[2]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[2]\n  occupied2[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[3])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[3])<tol/2)&&occupied2[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[3]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[3]\n  occupied2[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[4])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[4])<tol/2)&&occupied2[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[4]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[4]\n  occupied2[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[5])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[5])<tol/2)&&occupied2[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[5]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[5]\n  occupied2[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[6])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[6])<tol/2)&&occupied2[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[6]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[6]\n  occupied2[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[7])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[7])<tol/2)&&occupied2[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[7]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[7]\n  occupied2[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[8])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[8])<tol/2)&&occupied2[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[8]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[8]\n  occupied2[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[9])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[9])<tol/2)&&occupied2[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[9]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[9]\n  occupied2[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[10])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[10])<tol/2)&&occupied2[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[10]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[10]\n \n  occupied2[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[11])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[11])<tol/2)&&occupied2[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[11]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[11]\n occupied2[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[12])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[12])<tol/2)&&occupied2[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[12]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[12]\n  occupied2[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[13])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[13])<tol/2)&&occupied2[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[13]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[13]\n  occupied2[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[14])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[14])<tol/2)&&occupied2[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[14]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[14]\n  occupied2[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[15])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[15])<tol/2)&&occupied2[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[15]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[15]\n  occupied2[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[16])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[16])<tol/2)&&occupied2[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[16]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[16]\n  occupied2[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[17])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[17])<tol/2)&&occupied2[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[17]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[17]\n  occupied2[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[18])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[18])<tol/2)&&occupied2[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[18]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[18]\n  occupied2[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[19])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[19])<tol/2)&&occupied2[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[19]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[19]\n  occupied2[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[20])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[20])<tol/2)&&occupied2[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[20]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[20]\n \n  occupied2[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[21])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[21])<tol/2)&&occupied2[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[21]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[21]\n occupied2[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[22])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[22])<tol/2)&&occupied2[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[22]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[22]\n  occupied2[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[23])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[23])<tol/2)&&occupied2[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[23]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[23]\n  occupied2[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[24])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[24])<tol/2)&&occupied2[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[24]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[24]\n  occupied2[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[25])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[25])<tol/2)&&occupied2[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[25]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[25]\n  occupied2[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[26])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[26])<tol/2)&&occupied2[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[26]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[26]\n  occupied2[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[27])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[27])<tol/2)&&occupied2[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[27]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[27]\n  occupied2[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[28])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[28])<tol/2)&&occupied2[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[28]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[28]\n  occupied2[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[29])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[29])<tol/2)&&occupied2[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[29]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[29]\n  occupied2[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[30])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[30])<tol/2)&&occupied2[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[30]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[30]\n \n  occupied2[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimalss[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimalss[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[31]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[31])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[31])<tol/2)&&occupied2[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[31]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[31]\n occupied2[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimalss[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimalss[objectinteracted2];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals2[objectinteracted2]=xanimalss2[objectinteracted2]; // return to stored values initially\n  yanimals2[objectinteracted2]=yanimalss2[objectinteracted2];\n  }\n\n\n\n\n\ninstantanswer ();\n\n\n"
                  },
                  {
                    "name": "Sensitivity",
                    "value": "sensitivity"
                  },
                  {
                    "name": "SizeX",
                    "value": "0.15"
                  },
                  {
                    "name": "X",
                    "value": "xanimals2"
                  },
                  {
                    "name": "OnEnter",
                    "value": "objectinteracted2=objectinteracted2;"
                  },
                  {
                    "name": "Y",
                    "value": "yanimals2"
                  },
                  {
                    "name": "Visibility",
                    "value": "question==14"
                  },
                  {
                    "name": "SizeY",
                    "value": "0.15"
                  },
                  {
                    "name": "EnabledPosition",
                    "value": "enabledposition2"
                  }
                ]
              },
              {
                "Name": "second",
                "Type": "ShapeSet2D",
                "Properties": [
                  {
                    "name": "FillColor",
                    "value": "\"url(#mygrandient2)\""
                  },
                  {
                    "name": "ShapeType",
                    "value": "\"ELLIPSE\""
                  },
                  {
                    "name": "OnDrag",
                    "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//2 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals[i];\nvar dy = yanimals2[objectinteracted2] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter[i]/2)&&nanimalsshow==true) {\n    angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals[i], xanimals2[objectinteracted2] - xanimals[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n//2 electrons on 2nd rowelectrons\nfor (var i=0; i<objectinteracted2 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals2[i];\nvar dy = yanimals2[objectinteracted2] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals2[i], xanimals2[objectinteracted2] - xanimals2[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n//xanimals2[objectinteracted2]=xanimalss2[objectinteracted2]; //return to original position\n   //yanimals2[objectinteracted2]=yanimalss2[objectinteracted2]\n    // collision detected!\n}\n}\n//cannot self check\nfor (var i=objectinteracted2+1; i<=nanimals2 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals2[i];\nvar dy = yanimals2[objectinteracted2] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals2[i], xanimals2[objectinteracted2] - xanimals2[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n\n\n\n//2 electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals3[i];\nvar dy = yanimals2[objectinteracted2] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\nangleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals3[i], xanimals2[objectinteracted2] - xanimals3[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n\n}\n\n//2 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals4[i];\nvar dy = yanimals2[objectinteracted2] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals4[i], xanimals2[objectinteracted2] - xanimals4[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n//2 electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals2[objectinteracted2] - xanimals5[i];\nvar dy = yanimals2[objectinteracted2] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter2[objectinteracted2]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n  angleRadians2 = Math.atan2(yanimals2[objectinteracted2] - yanimals5[i], xanimals2[objectinteracted2] - xanimals5[i]);\nvar spacing=0.1;\nxanimals2[objectinteracted2]= xanimals2[objectinteracted2]+Math.cos(angleRadians2)*spacing;\nyanimals2[objectinteracted2]= yanimals2[objectinteracted2]+Math.sin(angleRadians2)*spacing;\n\n    // collision detected!\n}\n}\n"
                  },
                  {
                    "name": "ElementInteracted",
                    "value": "objectinteracted2"
                  },
                  {
                    "name": "NumberOfElements",
                    "value": "nanimals2"
                  },
                  {
                    "name": "OnRelease",
                    "value": "\n\n\n//if (occupied2[0]==false){\n if ((Math.abs(xanimals2[objectinteracted2]-xcell2[0])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[0])<tol/2)&&occupied2[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[0]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[0]\n \n//  occupied2[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[1])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[1])<tol/2)&&occupied2[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[1]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[1]\n //occupied2[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[2])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[2])<tol/2)&&occupied2[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[2]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[2]\n // occupied2[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[3])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[3])<tol/2)&&occupied2[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[3]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[3]\n // occupied2[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[4])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[4])<tol/2)&&occupied2[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[4]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[4]\n//  occupied2[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[5])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[5])<tol/2)&&occupied2[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[5]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[5]\n // occupied2[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[6])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[6])<tol/2)&&occupied2[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[6]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[6]\n // occupied2[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[7])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[7])<tol/2)&&occupied2[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[7]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[7]\n // occupied2[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[8])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[8])<tol/2)&&occupied2[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[8]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[8]\n // occupied2[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[9])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[9])<tol/2)&&occupied2[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[9]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[9]\n // occupied2[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[10])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[10])<tol/2)&&occupied2[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[10]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[10]\n \n // occupied2[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[11])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[11])<tol/2)&&occupied2[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[11]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[11]\n //occupied2[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[12])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[12])<tol/2)&&occupied2[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[12]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[12]\n // occupied2[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[13])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[13])<tol/2)&&occupied2[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[13]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[13]\n  occupied2[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[14])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[14])<tol/2)&&occupied2[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[14]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[14]\n // occupied2[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[15])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[15])<tol/2)&&occupied2[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[15]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[15]\n // occupied2[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[16])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[16])<tol/2)&&occupied2[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[16]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[16]\n // occupied2[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[17])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[17])<tol/2)&&occupied2[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[17]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[17]\n // occupied2[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[18])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[18])<tol/2)&&occupied2[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[18]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[18]\n // occupied2[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[19])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[19])<tol/2)&&occupied2[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[19]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[19]\n // occupied2[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[20])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[20])<tol/2)&&occupied2[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[20]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[20]\n \n // occupied2[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[21])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[21])<tol/2)&&occupied2[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[21]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[21]\n //occupied2[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimals2s[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimals2s[objectinteracted2];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[22])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[22])<tol/2)&&occupied2[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[22]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[22]\n // occupied2[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[23])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[23])<tol/2)&&occupied2[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[23]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[23]\n // occupied2[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[24])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[24])<tol/2)&&occupied2[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[24]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[24]\n // occupied2[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[25])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[25])<tol/2)&&occupied2[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[25]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[25]\n // occupied2[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[26])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[26])<tol/2)&&occupied2[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[26]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[26]\n // occupied2[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[27])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[27])<tol/2)&&occupied2[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[27]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[27]\n // occupied2[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[28])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[28])<tol/2)&&occupied2[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[28]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[28]\n // occupied2[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[29])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[29])<tol/2)&&occupied2[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[29]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[29]\n // occupied2[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals2[objectinteracted2]-xcell2[30])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[30])<tol/2)&&occupied2[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[30]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[30]\n \n // occupied2[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition2[objectinteracted2]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals2[objectinteracted2]=xanimalss[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimalss[objectinteracted2];\n // }\n//}\n\n\n//if (occupied2[31]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals2[objectinteracted2]-xcell2[31])<tol/2)&&(Math.abs(yanimals2[objectinteracted2]-ycell2[31])<tol/2)&&occupied2[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals2[objectinteracted2]=xcell2[31]; // for snapping to grid position\n   yanimals2[objectinteracted2]=ycell2[31]\n //occupied2[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition2[objectinteracted2]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals2[objectinteracted2]=xanimalss[objectinteracted2]; // return to stored values initially\n // yanimals2[objectinteracted2]=yanimalss[objectinteracted2];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals2[objectinteracted2]=xanimalss2[objectinteracted2]; // return to stored values initially\n  yanimals2[objectinteracted2]=yanimalss2[objectinteracted2];\n  }\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n"
                  },
                  {
                    "name": "Sensitivity",
                    "value": "sensitivity"
                  },
                  {
                    "name": "SizeX",
                    "value": "0.15"
                  },
                  {
                    "name": "X",
                    "value": "xanimals2"
                  },
                  {
                    "name": "OnEnter",
                    "value": "objectinteracted2=objectinteracted2;"
                  },
                  {
                    "name": "Y",
                    "value": "yanimals2"
                  },
                  {
                    "name": "Visibility",
                    "value": "question==14"
                  },
                  {
                    "name": "OnPress",
                    "value": "returnelectron1 ();"
                  },
                  {
                    "name": "SizeY",
                    "value": "0.15"
                  },
                  {
                    "name": "EnabledPosition",
                    "value": "enabledposition2"
                  }
                ]
              },
              {
                "Name": "thirdelectrononfirstatomq6n7",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==6||question==7"
                  }
                ],
                "Children": [
                  {
                    "Name": "third_electrons_on_1st_atom22",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color3"
                      },
                      {
                        "name": "Text",
                        "value": "textobject3"
                      },
                      {
                        "name": "Font",
                        "value": "font"
                      },
                      {
                        "name": "OnDrag",
                        "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//3 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals[i];\nvar dy = yanimals3[objectinteracted3] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter[i]/2)&&nanimalsshow==true) {\nangleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals[i], xanimals3[objectinteracted3] - xanimals[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//3 electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals2[i];\nvar dy = yanimals3[objectinteracted3] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals2[i], xanimals3[objectinteracted3] - xanimals2[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//3 electrons on 3nd rowelectrons\nfor (var i=0; i<objectinteracted3 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals3[i];\nvar dy = yanimals3[objectinteracted3] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals3[i], xanimals3[objectinteracted3] - xanimals3[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n//self check !\nfor (var i=objectinteracted3+1; i<=nanimals3 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals3[i];\nvar dy = yanimals3[objectinteracted3] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals3[i], xanimals3[objectinteracted3] - xanimals3[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n//3 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals4[i], xanimals3[objectinteracted3] - xanimals4[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n//3 electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals5[i];\nvar dy = yanimals3[objectinteracted3] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals5[i], xanimals3[objectinteracted3] - xanimals5[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
                      },
                      {
                        "name": "ElementInteracted",
                        "value": "objectinteracted3"
                      },
                      {
                        "name": "NumberOfElements",
                        "value": "nanimals3"
                      },
                      {
                        "name": "OnRelease",
                        "value": "\n\n\n//if (occupied[0]==false){\n if ((Math.abs(xanimals3[objectinteracted3]-xcell[0])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[0])<tol/2)&&occupied[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[0]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[0]\n \n // occupied[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[1])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[1])<tol/2)&&occupied[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[1]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[1]\n// occupied[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[2])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[2])<tol/2)&&occupied[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[2]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[2]\n // occupied[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[3])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[3])<tol/2)&&occupied[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[3]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[3]\n//  occupied[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[4])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[4])<tol/2)&&occupied[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[4]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[4]\n // occupied[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[5])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[5])<tol/2)&&occupied[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[5]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[5]\n // occupied[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[6])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[6])<tol/2)&&occupied[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[6]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[6]\n // occupied[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[7])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[7])<tol/2)&&occupied[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[7]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[7]\n // occupied[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[8])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[8])<tol/2)&&occupied[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[8]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[8]\n  occupied[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[9])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[9])<tol/2)&&occupied[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[9]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[9]\n // occupied[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[10])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[10])<tol/2)&&occupied[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[10]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[10]\n \n // occupied[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[11])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[11])<tol/2)&&occupied[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[11]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[11]\n //occupied[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[12])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[12])<tol/2)&&occupied[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[12]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[12]\n // occupied[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[13])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[13])<tol/2)&&occupied[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[13]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[13]\n // occupied[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[14])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[14])<tol/2)&&occupied[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[14]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[14]\n  //occupied[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[15])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[15])<tol/2)&&occupied[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[15]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[15]\n // occupied[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[16])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[16])<tol/2)&&occupied[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[16]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[16]\n // occupied[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[17])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[17])<tol/2)&&occupied[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[17]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[17]\n // occupied[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[18])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[18])<tol/2)&&occupied[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[18]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[18]\n // occupied[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[19])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[19])<tol/2)&&occupied[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[19]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[19]\n // occupied[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[20])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[20])<tol/2)&&occupied[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[20]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[20]\n \n  //occupied[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[21])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[21])<tol/2)&&occupied[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[21]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[21]\n //occupied[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[22])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[22])<tol/2)&&occupied[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[22]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[22]\n  //occupied[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[23])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[23])<tol/2)&&occupied[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[23]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[23]\n // occupied[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[24])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[24])<tol/2)&&occupied[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[24]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[24]\n // occupied[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[25])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[25])<tol/2)&&occupied[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[25]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[25]\n // occupied[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[26])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[26])<tol/2)&&occupied[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[26]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[26]\n // occupied[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[27])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[27])<tol/2)&&occupied[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[27]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[27]\n  //occupied[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[28])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[28])<tol/2)&&occupied[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[28]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[28]\n // occupied[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[29])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[29])<tol/2)&&occupied[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[29]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[29]\n  //occupied[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell[30])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[30])<tol/2)&&occupied[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[30]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[30]\n \n // occupied[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimalss[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss[objectinteracted3];\n // }\n//}\n\n\n//if (occupied[31]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell[31])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell[31])<tol/2)&&occupied[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell[31]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell[31]\n //occupied[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimalss[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss[objectinteracted3];\n // }\n\n//}\n\n\n\n//else { //catch all\n // xanimals3[objectinteracted3]=xanimalss3[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss3[objectinteracted3];\n // }\n\n\n\n\n\n\n\n//instantanswer ();\n//electron on second atom\n\n\n\n//if (occupied2[0]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[0])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[0])<tol/2)&&occupied2[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[0]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[0]\n \n // occupied2[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[1])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[1])<tol/2)&&occupied2[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[1]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[1]\n //occupied2[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[2])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[2])<tol/2)&&occupied2[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[2]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[2]\n // occupied2[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[3])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[3])<tol/2)&&occupied2[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[3]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[3]\n  //occupied2[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[4])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[4])<tol/2)&&occupied2[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[4]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[4]\n // occupied2[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[5])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[5])<tol/2)&&occupied2[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[5]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[5]\n // occupied2[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[6])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[6])<tol/2)&&occupied2[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[6]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[6]\n  occupied2[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[7])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[7])<tol/2)&&occupied2[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[7]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[7]\n // occupied2[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[8])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[8])<tol/2)&&occupied2[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[8]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[8]\n // occupied2[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[9])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[9])<tol/2)&&occupied2[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[9]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[9]\n  //occupied2[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[10])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[10])<tol/2)&&occupied2[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[10]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[10]\n \n // occupied2[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[11])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[11])<tol/2)&&occupied2[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[11]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[11]\n //occupied2[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[12])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[12])<tol/2)&&occupied2[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[12]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[12]\n // occupied2[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[13])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[13])<tol/2)&&occupied2[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[13]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[13]\n // occupied2[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[14])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[14])<tol/2)&&occupied2[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[14]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[14]\n // occupied2[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[15])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[15])<tol/2)&&occupied2[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[15]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[15]\n  //occupied2[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[16])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[16])<tol/2)&&occupied2[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[16]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[16]\n // occupied2[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[17])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[17])<tol/2)&&occupied2[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[17]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[17]\n // occupied2[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[18])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[18])<tol/2)&&occupied2[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[18]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[18]\n // occupied2[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[19])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[19])<tol/2)&&occupied2[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[19]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[19]\n // occupied2[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[20])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[20])<tol/2)&&occupied2[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[20]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[20]\n \n // occupied2[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n/* // need to remove for OH-1 to ensure count of sumshared2 is not added to sumsharede as they shared same position\n//21 to 27\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[21])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[21])<tol/2)&&occupied2[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[21]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[21]\n //occupied2[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[22])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[22])<tol/2)&&occupied2[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[22]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[22]\n // occupied2[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[23])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[23])<tol/2)&&occupied2[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[23]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[23]\n  //occupied2[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[24])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[24])<tol/2)&&occupied2[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[24]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[24]\n  //occupied2[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[25])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[25])<tol/2)&&occupied2[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[25]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[25]\n // occupied2[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[26])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[26])<tol/2)&&occupied2[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[26]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[26]\n // occupied2[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[27])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[27])<tol/2)&&occupied2[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[27]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[27]\n // occupied2[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n*/\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[28])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[28])<tol/2)&&occupied2[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[28]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[28]\n // occupied2[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[29])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[29])<tol/2)&&occupied2[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[29]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[29]\n // occupied2[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell2[30])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[30])<tol/2)&&occupied2[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[30]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[30]\n \n // occupied2[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimalss[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss[objectinteracted3];\n // }\n//}\n\n\n//if (occupied2[31]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell2[31])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell2[31])<tol/2)&&occupied2[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell2[31]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell2[31]\n //occupied2[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimalss[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss[objectinteracted3];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals3[objectinteracted3]=xanimalss3[objectinteracted3]; // return to stored values initially\n  yanimals3[objectinteracted3]=yanimalss3[objectinteracted3];\n  }\n\n\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
                      },
                      {
                        "name": "Sensitivity",
                        "value": "sensitivity"
                      },
                      {
                        "name": "X",
                        "value": "xanimals3"
                      },
                      {
                        "name": "OnEnter",
                        "value": "objectinteracted3=objectinteracted3;"
                      },
                      {
                        "name": "Y",
                        "value": "yanimals3"
                      },
                      {
                        "name": "Visibility",
                        "value": "nanimalsshow3"
                      },
                      {
                        "name": "OnPress",
                        "value": "returnelectron1 ();"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "enabledposition3"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "thirdelectrononthirdatom2",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question>=8"
                  }
                ],
                "Children": [
                  {
                    "Name": "third_electrons_on_third_atom22",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color3"
                      },
                      {
                        "name": "Text",
                        "value": "textobject3"
                      },
                      {
                        "name": "Font",
                        "value": "font"
                      },
                      {
                        "name": "OnDrag",
                        "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//3 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals[i];\nvar dy = yanimals3[objectinteracted3] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter[i]/2)&&nanimalsshow==true) {\nangleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals[i], xanimals3[objectinteracted3] - xanimals[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//3 electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals2[i];\nvar dy = yanimals3[objectinteracted3] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals2[i], xanimals3[objectinteracted3] - xanimals2[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//3 electrons on 3nd rowelectrons\nfor (var i=0; i<objectinteracted3 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals3[i];\nvar dy = yanimals3[objectinteracted3] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals3[i], xanimals3[objectinteracted3] - xanimals3[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n//self check !\nfor (var i=objectinteracted3+1; i<=nanimals3 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals3[i];\nvar dy = yanimals3[objectinteracted3] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals3[i], xanimals3[objectinteracted3] - xanimals3[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n//3 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals4[i], xanimals3[objectinteracted3] - xanimals4[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n//3 electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals5[i];\nvar dy = yanimals3[objectinteracted3] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals3[objectinteracted3] - yanimals5[i], xanimals3[objectinteracted3] - xanimals5[i]);\nvar spacing=0.1;\nxanimals3[objectinteracted3]= xanimals3[objectinteracted3]+Math.cos(angleRadians)*spacing;\nyanimals3[objectinteracted3]= yanimals3[objectinteracted3]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
                      },
                      {
                        "name": "ElementInteracted",
                        "value": "objectinteracted3"
                      },
                      {
                        "name": "NumberOfElements",
                        "value": "nanimals3"
                      },
                      {
                        "name": "OnRelease",
                        "value": "\n\n\n//if (occupied3[0]==false){\n if ((Math.abs(xanimals3[objectinteracted3]-xcell3[0])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[0])<tol/2)&&occupied3[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[0]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[0]\n \n // occupied3[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[1])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[1])<tol/2)&&occupied3[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[1]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[1]\n //occupied3[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[2])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[2])<tol/2)&&occupied3[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[2]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[2]\n  //occupied3[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[3])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[3])<tol/2)&&occupied3[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[3]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[3]\n // occupied3[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[4])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[4])<tol/2)&&occupied3[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[4]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[4]\n // occupied3[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[5])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[5])<tol/2)&&occupied3[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[5]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[5]\n // occupied3[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[6])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[6])<tol/2)&&occupied3[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[6]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[6]\n // occupied3[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[7])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[7])<tol/2)&&occupied3[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[7]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[7]\n // occupied3[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[8])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[8])<tol/2)&&occupied3[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[8]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[8]\n // occupied3[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[9])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[9])<tol/2)&&occupied3[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[9]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[9]\n // occupied3[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[10])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[10])<tol/2)&&occupied3[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[10]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[10]\n \n // occupied3[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[11])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[11])<tol/2)&&occupied3[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[11]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[11]\n //occupied3[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[12])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[12])<tol/2)&&occupied3[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[12]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[12]\n // occupied3[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[13])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[13])<tol/2)&&occupied3[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[13]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[13]\n // occupied3[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[14])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[14])<tol/2)&&occupied3[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[14]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[14]\n // occupied3[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[15])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[15])<tol/2)&&occupied3[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[15]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[15]\n // occupied3[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[16])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[16])<tol/2)&&occupied3[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[16]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[16]\n  //occupied3[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[17])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[17])<tol/2)&&occupied3[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[17]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[17]\n // occupied3[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[18])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[18])<tol/2)&&occupied3[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[18]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[18]\n  //occupied3[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[19])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[19])<tol/2)&&occupied3[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[19]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[19]\n  //occupied3[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[20])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[20])<tol/2)&&occupied3[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[20]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[20]\n \n  //occupied3[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[21])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[21])<tol/2)&&occupied3[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[21]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[21]\n //occupied3[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimals3s[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimals3s[objectinteracted3];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[22])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[22])<tol/2)&&occupied3[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[22]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[22]\n // occupied3[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[23])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[23])<tol/2)&&occupied3[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[23]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[23]\n // occupied3[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[24])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[24])<tol/2)&&occupied3[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[24]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[24]\n // occupied3[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[25])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[25])<tol/2)&&occupied3[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[25]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[25]\n  //occupied3[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[26])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[26])<tol/2)&&occupied3[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[26]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[26]\n  //occupied3[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[27])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[27])<tol/2)&&occupied3[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[27]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[27]\n  occupied3[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[28])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[28])<tol/2)&&occupied3[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[28]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[28]\n // occupied3[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[29])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[29])<tol/2)&&occupied3[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[29]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[29]\n // occupied3[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals3[objectinteracted3]-xcell3[30])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[30])<tol/2)&&occupied3[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[30]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[30]\n \n // occupied3[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition3[objectinteracted3]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals3[objectinteracted3]=xanimalss[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss[objectinteracted3];\n // }\n//}\n\n\n//if (occupied3[31]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals3[objectinteracted3]-xcell3[31])<tol/2)&&(Math.abs(yanimals3[objectinteracted3]-ycell3[31])<tol/2)&&occupied3[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals3[objectinteracted3]=xcell3[31]; // for snapping to grid position\n   yanimals3[objectinteracted3]=ycell3[31]\n //occupied3[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition3[objectinteracted3]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals3[objectinteracted3]=xanimalss[objectinteracted3]; // return to stored values initially\n // yanimals3[objectinteracted3]=yanimalss[objectinteracted3];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals3[objectinteracted3]=xanimalss3[objectinteracted3]; // return to stored values initially\n  yanimals3[objectinteracted3]=yanimalss3[objectinteracted3];\n  }\n\n\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n\n\n\n\n"
                      },
                      {
                        "name": "Sensitivity",
                        "value": "sensitivity"
                      },
                      {
                        "name": "X",
                        "value": "xanimals3"
                      },
                      {
                        "name": "OnEnter",
                        "value": "objectinteracted3=objectinteracted3;"
                      },
                      {
                        "name": "Y",
                        "value": "yanimals3"
                      },
                      {
                        "name": "Visibility",
                        "value": "nanimalsshow3"
                      },
                      {
                        "name": "OnPress",
                        "value": "returnelectron1 ();"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "enabledposition3"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "fourthelectronq10foegeine",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==10"
                  }
                ],
                "Children": [
                  {
                    "Name": "fourth_electrons_on_first_second_or_third_atom22",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color4"
                      },
                      {
                        "name": "Text",
                        "value": "textobject4"
                      },
                      {
                        "name": "Font",
                        "value": "font"
                      },
                      {
                        "name": "OnDrag",
                        "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//4 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals[i];\nvar dy = yanimals4[objectinteracted4] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter[i]/2)&&nanimalsshow==true) {\n  angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals[i], xanimals4[objectinteracted4] - xanimals[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals2[i];\nvar dy = yanimals4[objectinteracted4] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals2[i], xanimals4[objectinteracted4] - xanimals2[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals3[i];\nvar dy = yanimals4[objectinteracted4] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals3[i], xanimals4[objectinteracted4] - xanimals3[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n\n\n//4 electrons on 4 rowelectrons\nfor (var i=0; i<objectinteracted4 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals4[i];\nvar dy = yanimals4[objectinteracted4] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n    angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n//! self check\nfor (var i=objectinteracted4+1; i<=nanimals4 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals4[i];\nvar dy = yanimals4[objectinteracted4] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n\n//4 electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals5[i];\nvar dy = yanimals4[objectinteracted4] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow5==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals5[i], xanimals4[objectinteracted4] - xanimals5[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
                      },
                      {
                        "name": "ElementInteracted",
                        "value": "objectinteracted4"
                      },
                      {
                        "name": "NumberOfElements",
                        "value": "nanimals4"
                      },
                      {
                        "name": "OnRelease",
                        "value": "//catch on fist atom\n//if (occupied[0]==false){\n if ((Math.abs(xanimals4[objectinteracted4]-xcell[0])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[0])<tol/2)&&occupied[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[0]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[0]\n \n // occupied[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[1])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[1])<tol/2)&&occupied[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[1]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[1]\n //occupied[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[2])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[2])<tol/2)&&occupied[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[2]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[2]\n // occupied[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[3])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[3])<tol/2)&&occupied[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[3]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[3]\n // occupied[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[4])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[4])<tol/2)&&occupied[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[4]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[4]\n // occupied[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[5])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[5])<tol/2)&&occupied[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[5]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[5]\n // occupied[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[6])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[6])<tol/2)&&occupied[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[6]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[6]\n  //occupied[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[7])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[7])<tol/2)&&occupied[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[7]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[7]\n  //occupied[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[8])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[8])<tol/2)&&occupied[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[8]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[8]\n  //occupied[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[9])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[9])<tol/2)&&occupied[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[9]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[9]\n  //occupied[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[10])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[10])<tol/2)&&occupied[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[10]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[10]\n \n // occupied[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[11])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[11])<tol/2)&&occupied[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[11]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[11]\n //occupied[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[12])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[12])<tol/2)&&occupied[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[12]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[12]\n // occupied[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[13])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[13])<tol/2)&&occupied[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[13]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[13]\n // occupied[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[14])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[14])<tol/2)&&occupied[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[14]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[14]\n // occupied[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[15])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[15])<tol/2)&&occupied[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[15]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[15]\n // occupied[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[16])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[16])<tol/2)&&occupied[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[16]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[16]\n // occupied[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[17])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[17])<tol/2)&&occupied[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[17]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[17]\n // occupied[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[18])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[18])<tol/2)&&occupied[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[18]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[18]\n // occupied[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[19])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[19])<tol/2)&&occupied[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[19]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[19]\n // occupied[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[20])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[20])<tol/2)&&occupied[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[20]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[20]\n \n // occupied[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[21])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[21])<tol/2)&&occupied[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[21]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[21]\n //occupied[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[22])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[22])<tol/2)&&occupied[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[22]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[22]\n // occupied[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[23])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[23])<tol/2)&&occupied[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[23]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[23]\n  //occupied[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[24])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[24])<tol/2)&&occupied[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[24]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[24]\n  //occupied[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[25])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[25])<tol/2)&&occupied[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[25]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[25]\n // occupied[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[26])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[26])<tol/2)&&occupied[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[26]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[26]\n // occupied[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[27])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[27])<tol/2)&&occupied[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[27]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[27]\n // occupied[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[28])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[28])<tol/2)&&occupied[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[28]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[28]\n // occupied[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[29])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[29])<tol/2)&&occupied[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[29]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[29]\n // occupied[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell[30])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[30])<tol/2)&&occupied[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[30]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[30]\n \n  //occupied[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n//}\n\n\n//if (occupied[31]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell[31])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell[31])<tol/2)&&occupied[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell[31]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell[31]\n //occupied[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n\n//catch on second atom\n\n//if (occupied2[0]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[0])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[0])<tol/2)&&occupied2[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[0]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[0]\n \n // occupied2[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[1])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[1])<tol/2)&&occupied2[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[1]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[1]\n //occupied2[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[2])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[2])<tol/2)&&occupied2[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[2]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[2]\n // occupied2[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[3])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[3])<tol/2)&&occupied2[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[3]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[3]\n//  occupied2[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[4])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[4])<tol/2)&&occupied2[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[4]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[4]\n // occupied2[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[5])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[5])<tol/2)&&occupied2[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[5]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[5]\n // occupied2[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[6])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[6])<tol/2)&&occupied2[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[6]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[6]\n // occupied2[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[7])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[7])<tol/2)&&occupied2[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[7]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[7]\n // occupied2[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[8])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[8])<tol/2)&&occupied2[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[8]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[8]\n // occupied2[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[9])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[9])<tol/2)&&occupied2[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[9]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[9]\n // occupied2[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[10])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[10])<tol/2)&&occupied2[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[10]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[10]\n \n // occupied2[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[11])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[11])<tol/2)&&occupied2[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[11]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[11]\n //occupied2[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[12])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[12])<tol/2)&&occupied2[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[12]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[12]\n // occupied2[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[13])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[13])<tol/2)&&occupied2[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[13]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[13]\n // occupied2[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[14])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[14])<tol/2)&&occupied2[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[14]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[14]\n // occupied2[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[15])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[15])<tol/2)&&occupied2[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[15]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[15]\n // occupied2[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[16])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[16])<tol/2)&&occupied2[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[16]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[16]\n // occupied2[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[17])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[17])<tol/2)&&occupied2[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[17]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[17]\n // occupied2[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[18])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[18])<tol/2)&&occupied2[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[18]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[18]\n // occupied2[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[19])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[19])<tol/2)&&occupied2[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[19]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[19]\n // occupied2[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[20])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[20])<tol/2)&&occupied2[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[20]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[20]\n \n // occupied2[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[21])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[21])<tol/2)&&occupied2[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[21]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[21]\n //occupied2[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[22])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[22])<tol/2)&&occupied2[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[22]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[22]\n // occupied2[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[23])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[23])<tol/2)&&occupied2[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[23]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[23]\n // occupied2[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[24])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[24])<tol/2)&&occupied2[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[24]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[24]\n // occupied2[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[25])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[25])<tol/2)&&occupied2[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[25]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[25]\n // occupied2[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[26])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[26])<tol/2)&&occupied2[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[26]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[26]\n // occupied2[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[27])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[27])<tol/2)&&occupied2[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[27]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[27]\n // occupied2[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[28])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[28])<tol/2)&&occupied2[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[28]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[28]\n  //occupied2[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[29])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[29])<tol/2)&&occupied2[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[29]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[29]\n // occupied2[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell2[30])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[30])<tol/2)&&occupied2[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[30]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[30]\n \n // occupied2[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n//}\n\n\n//if (occupied2[31]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell2[31])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell2[31])<tol/2)&&occupied2[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell2[31]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell2[31]\n //occupied2[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n\n//}\n\n\n\n//else { //catch all\n  //xanimals4[objectinteracted4]=xanimalss4[objectinteracted4]; // return to stored values initially\n  //yanimals4[objectinteracted4]=yanimalss4[objectinteracted4];\n // }\n\n\n\n\n\n//instantanswer ();\n//catch on third atom\n\n\n\n\n//if (occupied3[0]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[0])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[0])<tol/2)&&occupied3[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[0]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[0]\n \n // occupied3[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n// check if electron is on third atom too for q10 nitrite ion\n\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[1])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[1])<tol/2)&&occupied3[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[1]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[1]\n //occupied3[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[2])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[2])<tol/2)&&occupied3[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[2]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[2]\n // occupied3[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[3])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[3])<tol/2)&&occupied3[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[3]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[3]\n // occupied3[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[4])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[4])<tol/2)&&occupied3[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[4]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[4]\n // occupied3[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[5])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[5])<tol/2)&&occupied3[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[5]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[5]\n // occupied3[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[6])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[6])<tol/2)&&occupied3[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[6]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[6]\n // occupied3[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[7])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[7])<tol/2)&&occupied3[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[7]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[7]\n  //occupied3[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[8])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[8])<tol/2)&&occupied3[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[8]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[8]\n // occupied3[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[9])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[9])<tol/2)&&occupied3[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[9]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[9]\n // occupied3[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[10])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[10])<tol/2)&&occupied3[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[10]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[10]\n \n // occupied3[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[11])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[11])<tol/2)&&occupied3[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[11]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[11]\n //occupied3[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[12])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[12])<tol/2)&&occupied3[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[12]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[12]\n // occupied3[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[13])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[13])<tol/2)&&occupied3[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[13]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[13]\n // occupied3[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[14])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[14])<tol/2)&&occupied3[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[14]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[14]\n // occupied3[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[15])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[15])<tol/2)&&occupied3[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[15]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[15]\n  //occupied3[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[16])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[16])<tol/2)&&occupied3[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[16]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[16]\n // occupied3[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[17])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[17])<tol/2)&&occupied3[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[17]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[17]\n // occupied3[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[18])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[18])<tol/2)&&occupied3[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[18]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[18]\n // occupied3[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[19])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[19])<tol/2)&&occupied3[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[19]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[19]\n // occupied3[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[20])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[20])<tol/2)&&occupied3[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[20]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[20]\n \n // occupied3[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[21])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[21])<tol/2)&&occupied3[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[21]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[21]\n //occupied3[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[22])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[22])<tol/2)&&occupied3[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[22]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[22]\n // occupied3[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[23])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[23])<tol/2)&&occupied3[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[23]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[23]\n // occupied3[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[24])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[24])<tol/2)&&occupied3[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[24]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[24]\n // occupied3[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[25])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[25])<tol/2)&&occupied3[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[25]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[25]\n // occupied3[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[26])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[26])<tol/2)&&occupied3[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[26]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[26]\n  //occupied3[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[27])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[27])<tol/2)&&occupied3[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[27]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[27]\n // occupied3[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[28])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[28])<tol/2)&&occupied3[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[28]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[28]\n // occupied3[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[29])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[29])<tol/2)&&occupied3[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[29]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[29]\n // occupied3[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell3[30])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[30])<tol/2)&&occupied3[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[30]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[30]\n \n // occupied3[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n//}\n\n\n//if (occupied3[31]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell3[31])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell3[31])<tol/2)&&occupied3[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell3[31]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell3[31]\n //occupied3[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals4[objectinteracted4]=xanimalss4[objectinteracted4]; // return to stored values initially\n  yanimals4[objectinteracted4]=yanimalss4[objectinteracted4];\n  }\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n\n\n\n\n"
                      },
                      {
                        "name": "Sensitivity",
                        "value": "sensitivity"
                      },
                      {
                        "name": "X",
                        "value": "xanimals4"
                      },
                      {
                        "name": "OnEnter",
                        "value": "objectinteracted4=objectinteracted4;"
                      },
                      {
                        "name": "Y",
                        "value": "yanimals4"
                      },
                      {
                        "name": "Visibility",
                        "value": "nanimalsshow4"
                      },
                      {
                        "name": "OnPress",
                        "value": "returnelectron1 ();"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "enabledposition4"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "fourthelectrononfourthatom",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question>=11"
                  }
                ],
                "Children": [
                  {
                    "Name": "fourth_electrons_on_fourth_atom2",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color4"
                      },
                      {
                        "name": "Text",
                        "value": "textobject4"
                      },
                      {
                        "name": "Font",
                        "value": "font"
                      },
                      {
                        "name": "OnDrag",
                        "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//4 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals[i];\nvar dy = yanimals4[objectinteracted4] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter[i]/2)&&nanimalsshow==true) {\n  angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals[i], xanimals4[objectinteracted4] - xanimals[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals2[i];\nvar dy = yanimals4[objectinteracted4] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals2[i], xanimals4[objectinteracted4] - xanimals2[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//4 electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals3[i];\nvar dy = yanimals4[objectinteracted4] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals3[i], xanimals4[objectinteracted4] - xanimals3[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n/*\n//4 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n*/\n\n//4 electrons on 4 rowelectrons\nfor (var i=0; i<objectinteracted4 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals4[i];\nvar dy = yanimals4[objectinteracted4] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n    angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n//! self check\nfor (var i=objectinteracted4+1; i<=nanimals4 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals4[i];\nvar dy = yanimals4[objectinteracted4] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals4[i], xanimals4[objectinteracted4] - xanimals4[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n\n//4 electrons on 5th rowelectrons\nfor (var i=0; i<=nanimals5 ; i++) {\n\nvar dx = xanimals4[objectinteracted4] - xanimals5[i];\nvar dy = yanimals4[objectinteracted4] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter4[objectinteracted4]/2 + diameter4[i]/2)&&nanimalsshow5==true) {\n     angleRadians = Math.atan2(yanimals4[objectinteracted4] - yanimals5[i], xanimals4[objectinteracted4] - xanimals5[i]);\nvar spacing=0.1;\nxanimals4[objectinteracted4]= xanimals4[objectinteracted4]+Math.cos(angleRadians)*spacing;\nyanimals4[objectinteracted4]= yanimals4[objectinteracted4]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
                      },
                      {
                        "name": "ElementInteracted",
                        "value": "objectinteracted4"
                      },
                      {
                        "name": "NumberOfElements",
                        "value": "nanimals4"
                      },
                      {
                        "name": "OnRelease",
                        "value": "\n\n\n//if (occupied4[0]==false){\n if ((Math.abs(xanimals4[objectinteracted4]-xcell4[0])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[0])<tol/2)&&occupied4[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[0]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[0]\n \n//  occupied4[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied4[1]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[1])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[1])<tol/2)&&occupied4[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[1]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[1]\n// occupied4[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied4[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[2])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[2])<tol/2)&&occupied4[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[2]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[2]\n // occupied4[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[3])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[3])<tol/2)&&occupied4[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[3]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[3]\n // occupied4[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[4])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[4])<tol/2)&&occupied4[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[4]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[4]\n // occupied4[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[5])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[5])<tol/2)&&occupied4[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[5]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[5]\n // occupied4[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[6])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[6])<tol/2)&&occupied4[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[6]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[6]\n // occupied4[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[7])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[7])<tol/2)&&occupied4[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[7]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[7]\n // occupied4[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[8])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[8])<tol/2)&&occupied4[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[8]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[8]\n // occupied4[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[9])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[9])<tol/2)&&occupied4[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[9]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[9]\n // occupied4[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[10])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[10])<tol/2)&&occupied4[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[10]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[10]\n \n // occupied4[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied4[1]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[11])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[11])<tol/2)&&occupied4[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[11]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[11]\n //occupied4[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied4[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[12])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[12])<tol/2)&&occupied4[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[12]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[12]\n // occupied4[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[13])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[13])<tol/2)&&occupied4[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[13]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[13]\n  //occupied4[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[14])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[14])<tol/2)&&occupied4[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[14]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[14]\n  //occupied4[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[15])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[15])<tol/2)&&occupied4[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[15]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[15]\n // occupied4[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[16])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[16])<tol/2)&&occupied4[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[16]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[16]\n // occupied4[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[17])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[17])<tol/2)&&occupied4[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[17]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[17]\n  //occupied4[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[18])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[18])<tol/2)&&occupied4[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[18]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[18]\n  //occupied4[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[19])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[19])<tol/2)&&occupied4[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[19]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[19]\n // occupied4[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[20])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[20])<tol/2)&&occupied4[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[20]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[20]\n \n // occupied4[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n//}\n\n\n//if (occupied4[1]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[21])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[21])<tol/2)&&occupied4[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[21]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[21]\n //occupied4[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimals4s[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimals4s[objectinteracted4];\n // }\n\n//}\n\n\n//if (occupied4[2]==false){\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[22])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[22])<tol/2)&&occupied4[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[22]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[22]\n // occupied4[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[23])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[23])<tol/2)&&occupied4[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[23]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[23]\n // occupied4[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[24])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[24])<tol/2)&&occupied4[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[24]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[24]\n // occupied4[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[25])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[25])<tol/2)&&occupied4[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[25]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[25]\n // occupied4[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[26])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[26])<tol/2)&&occupied4[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[26]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[26]\n // occupied4[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[27])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[27])<tol/2)&&occupied4[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[27]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[27]\n // occupied4[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[28])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[28])<tol/2)&&occupied4[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[28]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[28]\n // occupied4[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[29])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[29])<tol/2)&&occupied4[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[29]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[29]\n  //occupied4[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals4[objectinteracted4]-xcell4[30])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[30])<tol/2)&&occupied4[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[30]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[30]\n \n  //occupied4[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition4[objectinteracted4]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n//}\n\n\n//if (occupied4[31]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals4[objectinteracted4]-xcell4[31])<tol/2)&&(Math.abs(yanimals4[objectinteracted4]-ycell4[31])<tol/2)&&occupied4[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals4[objectinteracted4]=xcell4[31]; // for snapping to grid position\n   yanimals4[objectinteracted4]=ycell4[31]\n //occupied4[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition4[objectinteracted4]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals4[objectinteracted4]=xanimalss[objectinteracted4]; // return to stored values initially\n // yanimals4[objectinteracted4]=yanimalss[objectinteracted4];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals4[objectinteracted4]=xanimalss4[objectinteracted4]; // return to stored values initially\n  yanimals4[objectinteracted4]=yanimalss4[objectinteracted4];\n  }\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n\n\n\n\n"
                      },
                      {
                        "name": "Sensitivity",
                        "value": "sensitivity"
                      },
                      {
                        "name": "X",
                        "value": "xanimals4"
                      },
                      {
                        "name": "OnEnter",
                        "value": "objectinteracted4=objectinteracted4;"
                      },
                      {
                        "name": "Y",
                        "value": "yanimals4"
                      },
                      {
                        "name": "Visibility",
                        "value": "nanimalsshow4"
                      },
                      {
                        "name": "OnPress",
                        "value": "returnelectron1 ();"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "enabledposition4"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "fifthonfifth",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==12"
                  }
                ],
                "Children": [
                  {
                    "Name": "fifth_electrons_on_fifth_atom2",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color5"
                      },
                      {
                        "name": "Text",
                        "value": "textobject5"
                      },
                      {
                        "name": "Font",
                        "value": "font"
                      },
                      {
                        "name": "OnDrag",
                        "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//5 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals[i];\nvar dy = yanimals5[objectinteracted5] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter[i]/2)&&nanimalsshow==true) {\n    angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals[i], xanimals5[objectinteracted5] - xanimals[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals2[i];\nvar dy = yanimals5[objectinteracted5] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals2[i], xanimals5[objectinteracted5] - xanimals2[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals3[i];\nvar dy = yanimals5[objectinteracted5] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals3[i], xanimals5[objectinteracted5] - xanimals3[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n//5 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals3[objectinteracted3] - xanimals4[i];\nvar dy = yanimals3[objectinteracted3] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter3[objectinteracted3]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals4[i], xanimals5[objectinteracted5] - xanimals4[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n/*\n//5 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals4[i];\nvar dy = yanimals5[objectinteracted5] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals4[i], xanimals5[objectinteracted5] - xanimals4[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n*/\n\n\n//5 electrons on 5th rowelectrons\nfor (var i=0; i<objectinteracted5 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals5[i];\nvar dy = yanimals5[objectinteracted5] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals5[i], xanimals5[objectinteracted5] - xanimals5[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//!self check\nfor (var i=objectinteracted5+1; i<=nanimals5 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals5[i];\nvar dy = yanimals5[objectinteracted5] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals5[i], xanimals5[objectinteracted5] - xanimals5[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
                      },
                      {
                        "name": "ElementInteracted",
                        "value": "objectinteracted5"
                      },
                      {
                        "name": "NumberOfElements",
                        "value": "nanimals5"
                      },
                      {
                        "name": "OnRelease",
                        "value": "\n\n\n//if (occupied5[0]==false){\n if ((Math.abs(xanimals5[objectinteracted5]-xcell5[0])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[0])<tol/2)&&occupied5[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[0]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[0]\n \n // occupied5[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied5[1]==false){ // cannot use else if cos need to check all occupied5 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[1])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[1])<tol/2)&&occupied5[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[1]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[1]\n //occupied5[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied5[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[2])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[2])<tol/2)&&occupied5[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[2]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[2]\n // occupied5[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[3])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[3])<tol/2)&&occupied5[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[3]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[3]\n // occupied5[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[4])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[4])<tol/2)&&occupied5[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[4]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[4]\n  //occupied5[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[5])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[5])<tol/2)&&occupied5[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[5]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[5]\n // occupied5[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[6])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[6])<tol/2)&&occupied5[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[6]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[6]\n // occupied5[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[7])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[7])<tol/2)&&occupied5[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[7]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[7]\n  //occupied5[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[8])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[8])<tol/2)&&occupied5[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[8]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[8]\n // occupied5[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[9])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[9])<tol/2)&&occupied5[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[9]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[9]\n // occupied5[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[10])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[10])<tol/2)&&occupied5[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[10]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[10]\n \n // occupied5[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied5[1]==false){ // cannot use else if cos need to check all occupied5 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[11])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[11])<tol/2)&&occupied5[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[11]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[11]\n //occupied5[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied5[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[12])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[12])<tol/2)&&occupied5[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[12]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[12]\n // occupied5[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[13])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[13])<tol/2)&&occupied5[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[13]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[13]\n // occupied5[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[14])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[14])<tol/2)&&occupied5[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[14]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[14]\n  //occupied5[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[15])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[15])<tol/2)&&occupied5[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[15]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[15]\n // occupied5[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[16])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[16])<tol/2)&&occupied5[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[16]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[16]\n  //occupied5[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[17])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[17])<tol/2)&&occupied5[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[17]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[17]\n // occupied5[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[18])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[18])<tol/2)&&occupied5[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[18]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[18]\n // occupied5[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[19])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[19])<tol/2)&&occupied5[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[19]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[19]\n // occupied5[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[20])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[20])<tol/2)&&occupied5[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[20]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[20]\n \n  //occupied5[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied5[1]==false){ // cannot use else if cos need to check all occupied5 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[21])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[21])<tol/2)&&occupied5[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[21]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[21]\n //occupied5[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied5[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[22])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[22])<tol/2)&&occupied5[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[22]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[22]\n // occupied5[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[23])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[23])<tol/2)&&occupied5[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[23]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[23]\n // occupied5[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[24])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[24])<tol/2)&&occupied5[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[24]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[24]\n // occupied5[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[25])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[25])<tol/2)&&occupied5[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[25]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[25]\n // occupied5[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[26])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[26])<tol/2)&&occupied5[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[26]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[26]\n // occupied5[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[27])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[27])<tol/2)&&occupied5[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[27]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[27]\n // occupied5[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[28])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[28])<tol/2)&&occupied5[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[28]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[28]\n  //occupied5[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[29])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[29])<tol/2)&&occupied5[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[29]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[29]\n // occupied5[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell5[30])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[30])<tol/2)&&occupied5[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[30]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[30]\n \n // occupied5[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n//}\n\n\n//if (occupied5[31]==false){ // cannot use else if cos need to check all occupied5 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell5[31])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell5[31])<tol/2)&&occupied5[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell5[31]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell5[31]\n //occupied5[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n\n//}\n\n\n\nelse { //catch all\n  xanimals5[objectinteracted5]=xanimalss5[objectinteracted5]; // return to stored values initially\n  yanimals5[objectinteracted5]=yanimalss5[objectinteracted5];\n  }\n\n\n\n\n\ninstantanswer ();\ninstantchecking ();\n\n\n\n\n\n\n\n"
                      },
                      {
                        "name": "Sensitivity",
                        "value": "sensitivity"
                      },
                      {
                        "name": "X",
                        "value": "xanimals5"
                      },
                      {
                        "name": "OnEnter",
                        "value": "objectinteracted5=objectinteracted5;"
                      },
                      {
                        "name": "Y",
                        "value": "yanimals5"
                      },
                      {
                        "name": "Visibility",
                        "value": "nanimalsshow5"
                      },
                      {
                        "name": "OnPress",
                        "value": "returnelectron1 ();"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "enabledposition5"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "fifthonsecondandthirdatom",
                "Type": "Group2D",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "question==13||question==15"
                  }
                ],
                "Children": [
                  {
                    "Name": "fifth_electrons_on_1secondthird4atom",
                    "Type": "TextSet2D",
                    "Properties": [
                      {
                        "name": "FillColor",
                        "value": "color5"
                      },
                      {
                        "name": "Text",
                        "value": "textobject5"
                      },
                      {
                        "name": "Font",
                        "value": "font"
                      },
                      {
                        "name": "OnDrag",
                        "value": "//https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n//var circle1 = {radius: 20, x: 5, y: 5};\n//var circle2 = {radius: 12, x: 10, y: 5};\n\n//5 electrons on 1st rowelectrons\nfor (var i=0; i<=nanimals ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals[i];\nvar dy = yanimals5[objectinteracted5] - yanimals[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter[i]/2)&&nanimalsshow==true) {\n    angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals[i], xanimals5[objectinteracted5] - xanimals[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 2nd rowelectrons\nfor (var i=0; i<=nanimals2 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals2[i];\nvar dy = yanimals5[objectinteracted5] - yanimals2[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter2[i]/2)&&nanimalsshow2==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals2[i], xanimals5[objectinteracted5] - xanimals2[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//5 electrons on 3nd rowelectrons\nfor (var i=0; i<=nanimals3 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals3[i];\nvar dy = yanimals5[objectinteracted5] - yanimals3[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter3[i]/2)&&nanimalsshow3==true) {\n  angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals3[i], xanimals5[objectinteracted5] - xanimals3[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n\n}\n\n\n\n\n//5 electrons on 4 rowelectrons\nfor (var i=0; i<=nanimals4 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals4[i];\nvar dy = yanimals5[objectinteracted5] - yanimals4[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter4[i]/2)&&nanimalsshow4==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals4[i], xanimals5[objectinteracted5] - xanimals4[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n\n\n//5 electrons on 5th rowelectrons\nfor (var i=0; i<objectinteracted5 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals5[i];\nvar dy = yanimals5[objectinteracted5] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals5[i], xanimals5[objectinteracted5] - xanimals5[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n\n//!self check\nfor (var i=objectinteracted5+1; i<=nanimals5 ; i++) {\n\nvar dx = xanimals5[objectinteracted5] - xanimals5[i];\nvar dy = yanimals5[objectinteracted5] - yanimals5[i];\nvar distance = Math.sqrt(dx * dx + dy * dy);\n\nif ((distance < diameter5[objectinteracted5]/2 + diameter5[i]/2)&&nanimalsshow5==true) {\n   angleRadians = Math.atan2(yanimals5[objectinteracted5] - yanimals5[i], xanimals5[objectinteracted5] - xanimals5[i]);\nvar spacing=0.1;\nxanimals5[objectinteracted5]= xanimals5[objectinteracted5]+Math.cos(angleRadians)*spacing;\nyanimals5[objectinteracted5]= yanimals5[objectinteracted5]+Math.sin(angleRadians)*spacing;\n    // collision detected!\n}\n}\n"
                      },
                      {
                        "name": "ElementInteracted",
                        "value": "objectinteracted5"
                      },
                      {
                        "name": "NumberOfElements",
                        "value": "nanimals5"
                      },
                      {
                        "name": "OnRelease",
                        "value": "//checking 5th row of electrons landing on 1nd atom\n\n//if (occupied[0]==false){\n if ((Math.abs(xanimals5[objectinteracted5]-xcell[0])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[0])<tol/2)&&occupied[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[0]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[0]\n \n  //occupied[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[1])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[1])<tol/2)&&occupied[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[1]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[1]\n //occupied[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[2])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[2])<tol/2)&&occupied[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[2]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[2];\n // occupied[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[3])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[3])<tol/2)&&occupied[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[3]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[3];\n // occupied[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[4])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[4])<tol/2)&&occupied[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[4]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[4];\n  //occupied[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[5])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[5])<tol/2)&&occupied[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[5]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[5]\n  //occupied[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[6])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[6])<tol/2)&&occupied[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[6]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[6]\n  //occupied[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[7])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[7])<tol/2)&&occupied[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[7]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[7]\n  //occupied[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[8])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[8])<tol/2)&&occupied[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[8]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[8]\n // occupied[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[9])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[9])<tol/2)&&occupied[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[9]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[9]\n // occupied[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[10])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[10])<tol/2)&&occupied[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[10]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[10]\n \n  //occupied[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[11])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[11])<tol/2)&&occupied[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[11]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[11]\n //occupied[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[12])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[12])<tol/2)&&occupied[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[12]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[12]\n  //occupied[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[13])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[13])<tol/2)&&occupied[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[13]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[13]\n  //occupied[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[14])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[14])<tol/2)&&occupied[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[14]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[14]\n  //occupied[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[15])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[15])<tol/2)&&occupied[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[15]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[15]\n  //occupied[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[16])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[16])<tol/2)&&occupied[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[16]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[16]\n // occupied[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[17])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[17])<tol/2)&&occupied[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[17]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[17]\n  //occupied[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[18])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[18])<tol/2)&&occupied[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[18]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[18]\n  //occupied[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[19])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[19])<tol/2)&&occupied[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[19]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[19]\n  //occupied[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[20])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[20])<tol/2)&&occupied[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[20]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[20]\n \n // occupied[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied[1]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[21])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[21])<tol/2)&&occupied[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[21]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[21]\n //occupied[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[22])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[22])<tol/2)&&occupied[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[22]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[22]\n // occupied[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[23])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[23])<tol/2)&&occupied[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[23]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[23]\n // occupied[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[24])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[24])<tol/2)&&occupied[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[24]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[24]\n // occupied[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[25])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[25])<tol/2)&&occupied[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[25]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[25]\n // occupied[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[26])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[26])<tol/2)&&occupied[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[26]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[26]\n  //occupied[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[27])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[27])<tol/2)&&occupied[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[27]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[27]\n  //occupied[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[28])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[28])<tol/2)&&occupied[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[28]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[28]\n  //occupied[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[29])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[29])<tol/2)&&occupied[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[29]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[29]\n  //occupied[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell[30])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[30])<tol/2)&&occupied[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[30]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[30]\n \n // occupied[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n//}\n\n\n//if (occupied[31]==false){ // cannot use else if cos need to check all occupied cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell[31])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell[31])<tol/2)&&occupied[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell[31]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell[31]\n //occupied[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n\n//2nd atom\n//if (occupied2[0]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[0])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[0])<tol/2)&&occupied2[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[0]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[0]\n \n // occupied2[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[1])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[1])<tol/2)&&occupied2[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[1]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[1]\n //occupied2[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[2])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[2])<tol/2)&&occupied2[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[2]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[2]\n // occupied2[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[3])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[3])<tol/2)&&occupied2[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[3]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[3]\n // occupied2[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[4])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[4])<tol/2)&&occupied2[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[4]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[4]\n // occupied2[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[5])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[5])<tol/2)&&occupied2[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[5]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[5]\n // occupied2[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[6])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[6])<tol/2)&&occupied2[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[6]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[6]\n // occupied2[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[7])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[7])<tol/2)&&occupied2[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[7]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[7]\n // occupied2[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[8])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[8])<tol/2)&&occupied2[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[8]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[8]\n // occupied2[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[9])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[9])<tol/2)&&occupied2[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[9]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[9]\n // occupied2[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[10])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[10])<tol/2)&&occupied2[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[10]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[10]\n \n  //occupied2[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[11])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[11])<tol/2)&&occupied2[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[11]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[11]\n //occupied2[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[12])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[12])<tol/2)&&occupied2[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[12]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[12]\n // occupied2[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[13])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[13])<tol/2)&&occupied2[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[13]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[13]\n // occupied2[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[14])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[14])<tol/2)&&occupied2[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[14]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[14]\n // occupied2[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[15])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[15])<tol/2)&&occupied2[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[15]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[15]\n // occupied2[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[16])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[16])<tol/2)&&occupied2[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[16]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[16]\n // occupied2[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[17])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[17])<tol/2)&&occupied2[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[17]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[17]\n // occupied2[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[18])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[18])<tol/2)&&occupied2[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[18]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[18]\n  //occupied2[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[19])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[19])<tol/2)&&occupied2[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[19]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[19]\n // occupied2[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[20])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[20])<tol/2)&&occupied2[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[20]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[20]\n \n // occupied2[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied2[1]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[21])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[21])<tol/2)&&occupied2[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[21]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[21]\n //occupied2[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied2[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[22])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[22])<tol/2)&&occupied2[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[22]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[22]\n  //occupied2[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[23])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[23])<tol/2)&&occupied2[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[23]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[23]\n // occupied2[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[24])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[24])<tol/2)&&occupied2[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[24]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[24]\n  //occupied2[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[25])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[25])<tol/2)&&occupied2[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[25]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[25]\n // occupied2[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[26])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[26])<tol/2)&&occupied2[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[26]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[26]\n // occupied2[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[27])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[27])<tol/2)&&occupied2[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[27]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[27]\n  //occupied2[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[28])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[28])<tol/2)&&occupied2[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[28]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[28]\n  //occupied2[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[29])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[29])<tol/2)&&occupied2[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[29]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[29]\n  //occupied2[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell2[30])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[30])<tol/2)&&occupied2[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[30]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[30]\n \n // occupied2[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n//}\n\n\n//if (occupied2[31]==false){ // cannot use else if cos need to check all occupied2 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell2[31])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell2[31])<tol/2)&&occupied2[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell2[31]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell2[31]\n //occupied2[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n\n//}\n\n\n\n\n\n\n\n\n\n\n//checking fifth row of electrons landing on third atom\n\n\n\n\n//if (occupied3[0]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[0])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[0])<tol/2)&&occupied3[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[0]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[0]\n \n // occupied3[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[1])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[1])<tol/2)&&occupied3[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[1]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[1]\n //occupied3[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[2])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[2])<tol/2)&&occupied3[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[2]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[2]\n  //occupied3[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[3])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[3])<tol/2)&&occupied3[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[3]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[3]\n // occupied3[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[4])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[4])<tol/2)&&occupied3[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[4]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[4]\n // occupied3[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[5])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[5])<tol/2)&&occupied3[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[5]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[5]\n // occupied3[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[6])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[6])<tol/2)&&occupied3[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[6]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[6]\n // occupied3[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[7])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[7])<tol/2)&&occupied3[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[7]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[7]\n // occupied3[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[8])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[8])<tol/2)&&occupied3[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[8]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[8]\n  //occupied3[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[9])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[9])<tol/2)&&occupied3[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[9]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[9]\n  //occupied3[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[10])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[10])<tol/2)&&occupied3[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[10]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[10]\n \n // occupied3[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[11])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[11])<tol/2)&&occupied3[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[11]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[11]\n //occupied3[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[12])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[12])<tol/2)&&occupied3[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[12]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[12]\n // occupied3[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[13])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[13])<tol/2)&&occupied3[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[13]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[13]\n // occupied3[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[14])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[14])<tol/2)&&occupied3[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[14]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[14]\n  occupied3[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[15])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[15])<tol/2)&&occupied3[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[15]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[15]\n // occupied3[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[16])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[16])<tol/2)&&occupied3[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[16]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[16]\n // occupied3[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[17])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[17])<tol/2)&&occupied3[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[17]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[17]\n // occupied3[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[18])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[18])<tol/2)&&occupied3[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[18]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[18]\n // occupied3[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[19])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[19])<tol/2)&&occupied3[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[19]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[19]\n  //occupied3[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[20])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[20])<tol/2)&&occupied3[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[20]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[20]\n \n // occupied3[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied3[1]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[21])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[21])<tol/2)&&occupied3[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[21]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[21]\n //occupied3[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied3[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[22])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[22])<tol/2)&&occupied3[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[22]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[22]\n // occupied3[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[23])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[23])<tol/2)&&occupied3[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[23]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[23]\n // occupied3[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[24])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[24])<tol/2)&&occupied3[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[24]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[24]\n // occupied3[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[25])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[25])<tol/2)&&occupied3[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[25]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[25]\n // occupied3[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[26])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[26])<tol/2)&&occupied3[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[26]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[26]\n // occupied3[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[27])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[27])<tol/2)&&occupied3[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[27]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[27]\n  //occupied3[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[28])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[28])<tol/2)&&occupied3[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[28]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[28]\n  //occupied3[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[29])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[29])<tol/2)&&occupied3[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[29]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[29]\n  //occupied3[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell3[30])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[30])<tol/2)&&occupied3[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[30]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[30]\n \n // occupied3[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n//}\n\n\n//if (occupied3[31]==false){ // cannot use else if cos need to check all occupied3 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell3[31])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell3[31])<tol/2)&&occupied3[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell3[31]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell3[31]\n //occupied3[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n\n//}\n\n\n\n//else { //catch all\n // xanimals5[objectinteracted5]=xanimalss5[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss5[objectinteracted5];\n // }\n\n\n\n\n\n//instantanswer ();\n\n\n\n//if (occupied4[0]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[0])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[0])<tol/2)&&occupied4[0]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[0]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[0]\n \n // occupied4[0]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n\n\n//4th atom\n\n//if (occupied4[1]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[1])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[1])<tol/2)&&occupied4[1]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[1]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[1]\n// occupied4[1]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied4[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[2])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[2])<tol/2)&&occupied4[2]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[2]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[2]\n // occupied4[2]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[3])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[3])<tol/2)&&occupied4[3]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[3]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[3]\n // occupied4[3]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[4])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[4])<tol/2)&&occupied4[4]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[4]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[4]\n  //occupied4[4]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[5])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[5])<tol/2)&&occupied4[5]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[5]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[5]\n // occupied4[5]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[6])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[6])<tol/2)&&occupied4[6]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[6]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[6]\n // occupied4[6]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[7])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[7])<tol/2)&&occupied4[7]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[7]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[7]\n // occupied4[7]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[8])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[8])<tol/2)&&occupied4[8]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[8]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[8]\n // occupied4[8]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[9])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[9])<tol/2)&&occupied4[9]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[9]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[9]\n // occupied4[9]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//10\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[10])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[10])<tol/2)&&occupied4[10]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[10]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[10]\n \n // occupied4[10]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied4[1]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[11])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[11])<tol/2)&&occupied4[11]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[11]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[11]\n //occupied4[11]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied4[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[12])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[12])<tol/2)&&occupied4[12]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[12]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[12]\n // occupied4[12]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[13])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[13])<tol/2)&&occupied4[13]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[13]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[13]\n // occupied4[13]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[14])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[14])<tol/2)&&occupied4[14]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[14]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[14]\n // occupied4[14]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[15])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[15])<tol/2)&&occupied4[15]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[15]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[15]\n // occupied4[15]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[16])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[16])<tol/2)&&occupied4[16]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[16]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[16]\n // occupied4[16]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[17])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[17])<tol/2)&&occupied4[17]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[17]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[17]\n // occupied4[17]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[18])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[18])<tol/2)&&occupied4[18]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[18]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[18]\n // occupied4[18]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[19])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[19])<tol/2)&&occupied4[19]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[19]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[19]\n  //occupied4[19]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n\n//20\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[20])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[20])<tol/2)&&occupied4[20]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[20]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[20]\n \n  //occupied4[20]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n//}\n\n\n//if (occupied4[1]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[21])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[21])<tol/2)&&occupied4[21]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[21]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[21]\n //occupied4[21]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n//else {\n // xanimals5[objectinteracted5]=xanimals5s[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimals5s[objectinteracted5];\n // }\n\n//}\n\n\n//if (occupied4[2]==false){\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[22])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[22])<tol/2)&&occupied4[22]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[22]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[22]\n // occupied4[22]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[23])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[23])<tol/2)&&occupied4[23]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[23]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[23]\n // occupied4[23]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[24])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[24])<tol/2)&&occupied4[24]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[24]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[24]\n // occupied4[24]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[25])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[25])<tol/2)&&occupied4[25]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[25]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[25]\n // occupied4[25]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[26])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[26])<tol/2)&&occupied4[26]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[26]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[26]\n // occupied4[26]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[27])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[27])<tol/2)&&occupied4[27]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[27]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[27]\n // occupied4[27]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[28])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[28])<tol/2)&&occupied4[28]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[28]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[28]\n // occupied4[28]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[29])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[29])<tol/2)&&occupied4[29]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[29]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[29]\n  //occupied4[29]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\n//30\nelse if ((Math.abs(xanimals5[objectinteracted5]-xcell4[30])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[30])<tol/2)&&occupied4[30]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[30]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[30]\n \n // occupied4[30]=1; // to prevent same cell used again by another like a first time\n  //enabledposition5[objectinteracted5]=\"ENABLED_NONE\"; //prevent another drag\n // break; // appears to need to break out of loop so it doesnt check the rest\n\n}\n//else {\n//  xanimals5[objectinteracted5]=xanimalss[objectinteracted5]; // return to stored values initially\n // yanimals5[objectinteracted5]=yanimalss[objectinteracted5];\n // }\n//}\n\n\n//if (occupied4[31]==false){ // cannot use else if cos need to check all occupied4 cases?\n else if ((Math.abs(xanimals5[objectinteracted5]-xcell4[31])<tol/2)&&(Math.abs(yanimals5[objectinteracted5]-ycell4[31])<tol/2)&&occupied4[31]==false){ //second\n  //alert(\"i=\"+i+\"  j=\"+j);\n  xanimals5[objectinteracted5]=xcell4[31]; // for snapping to grid position\n   yanimals5[objectinteracted5]=ycell4[31]\n //occupied4[31]=1; // to prevent same cell used again by another like a first time\n //enabledposition5[objectinteracted5]=\"ENABLED_NONE\";\n // break; // appears to need to break out of loop so it doesnt check the rest\n}\n\nelse {\n  xanimals5[objectinteracted5]=xanimalss5[objectinteracted5]; // return to stored values initially\n  yanimals5[objectinteracted5]=yanimalss5[objectinteracted5];\n  }\n\n\n\n\n\ninstantchecking ();\n\n\n\n\n\n\n\n\n\n\n"
                      },
                      {
                        "name": "Sensitivity",
                        "value": "sensitivity"
                      },
                      {
                        "name": "X",
                        "value": "xanimals5"
                      },
                      {
                        "name": "OnEnter",
                        "value": "objectinteracted5=objectinteracted5;"
                      },
                      {
                        "name": "Y",
                        "value": "yanimals5"
                      },
                      {
                        "name": "Visibility",
                        "value": "nanimalsshow5"
                      },
                      {
                        "name": "OnPress",
                        "value": "returnelectron1 ();"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "enabledposition5"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "symmetry_line_for_q13",
                "Type": "Segment2D",
                "Properties": [
                  {
                    "name": "SizeX",
                    "value": "0"
                  },
                  {
                    "name": "Attributes",
                    "value": "{ \"stroke-dasharray\":\"8 8 8 8\" } "
                  },
                  {
                    "name": "X",
                    "value": "0"
                  },
                  {
                    "name": "Y",
                    "value": "0"
                  },
                  {
                    "name": "Visibility",
                    "value": "false"
                  },
                  {
                    "name": "SizeY",
                    "value": "5"
                  },
                  {
                    "name": "LineWidth",
                    "value": "2"
                  },
                  {
                    "name": "Offset",
                    "value": "\"CENTERED\""
                  }
                ]
              }
            ]
          },
          {
            "Name": "html",
            "Type": "Panel",
            "Properties": [
              {
                "name": "Html",
                "value": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/onyBqBW9hEg?si=fI2X_pmhnCBI8M3R\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe><style>\n.dc-s{margin:8px 0;padding:8px 10px;border-radius:5px;font-family:Georgia,serif}\n.dc-obj{background:#e8f4fd;border-left:4px solid #2196F3}\n.dc-ref{background:#f0fdf4;border-left:4px solid #4CAF50}\n.dc-ref table{border-collapse:collapse;font-size:0.85em;width:100%}\n.dc-ref td,.dc-ref th{padding:2px 7px;border:1px solid #ccc;text-align:center}\n.dc-ref th{background:#4CAF50;color:white}\nsummary{cursor:pointer;font-weight:bold;font-size:0.95em}\ndetails{margin:2px 0}\n</style>\n\n<div class=\"dc-s dc-obj\" style=\"display:none\">\n<details open><summary>&#x1F3AF; Learning Objectives</summary>\n<ol style=\"font-size:0.9em;margin:4px 0;line-height:1.5\">\n<li>State that a covalent bond is a <b>shared pair of electrons</b></li>\n<li>Draw dot-and-cross diagrams for simple covalent molecules and ions</li>\n<li>Identify <b>bonding pairs</b> and <b>lone pairs</b> in a structure</li>\n<li>Link the number of bonding pairs to bond type (single / double / triple)</li>\n<li>Connect the electron structure to the molecule&#39;s <b>shape</b> and <b>polarity</b></li>\n</ol>\n</details>\n</div>\n\n<div class=\"dc-s dc-ref\" style=\"display:none\">\n<details><summary>&#x1F4CB; Valence Electron Quick Reference</summary>\n<table>\n<tr><th>Atom</th><th>Group</th><th>Valence e&#x207b;</th><th>Needs</th><th>Rule</th></tr>\n<tr><td>H</td><td>1</td><td>1</td><td>1 more</td><td>Duplet (2)</td></tr>\n<tr><td>C</td><td>14</td><td>4</td><td>4 more</td><td>Octet (8)</td></tr>\n<tr><td>N</td><td>15</td><td>5</td><td>3 more</td><td>Octet (8)</td></tr>\n<tr><td>O</td><td>16</td><td>6</td><td>2 more</td><td>Octet (8)</td></tr>\n<tr><td>F</td><td>17</td><td>7</td><td>1 more</td><td>Octet (8)</td></tr>\n<tr><td>Cl</td><td>17</td><td>7</td><td>1 more</td><td>Octet (8)</td></tr>\n<tr><td>S</td><td>16</td><td>6</td><td>2 more</td><td>Octet (8)</td></tr>\n</table>\n<p style=\"font-size:0.85em;margin:4px 0\"><b>Ions:</b> each extra negative charge = 1 extra electron to place on atoms.</p>\n</details>\n</div>\n\n<!-- Dynamic panels \u2014 content injected by polling script in page head -->\n<div id=\"dc-molinfo\" style=\"font-family:Georgia,serif;padding:4px 0;display:none\">\n  <p style=\"color:#888;font-size:0.9em\">Select a molecule from the dropdown to see shape and real-world context.</p>\n</div>\n<div id=\"dc-progress\" style=\"font-family:Georgia,serif;padding:4px 0\">\n  <p style=\"color:#888;font-size:0.9em\">Your progress will appear here after you complete molecules.</p>\n</div>\n\n<hr style=\"border:1px solid #ddd;margin:8px 0\">\nPeriodic Table from SEAB O level Chemistry Syllabus page 30\n<center>&#x1F4F8; <a href=\"https://www.seab.gov.sg/files/O%20Lvl%20Syllabus%20Sch%20Cddts/2026/6092_y26_sy.pdf\">https://www.seab.gov.sg/files/O%20Lvl%20Syllabus%20Sch%20Cddts/2026/6092_y26_sy.pdf</a></center>\n<center><a href=\"https://www.seab.gov.sg/files/O%20Lvl%20Syllabus%20Sch%20Cddts/2025/6092_y25_sy.pdf\">https://www.seab.gov.sg/files/O%20Lvl%20Syllabus%20Sch%20Cddts/2025/6092_y25_sy.pdf</a></center>\n<center>&#x1F9EA; More Chemistry Interactives: <a href=\"https://sg.iwant2study.org/ospsg/index.php/interactive-resources/chemistry/03-chemistry-of-reactions\">sg.iwant2study.org</a></center>"
              }
            ]
          },
          {
            "Name": "periodic_table",
            "Type": "HtmlArea",
            "Properties": [
              {
                "name": "Tooltip",
                "value": "\"https://www.seab.gov.sg/files/O%20Lvl%20Syllabus%20Sch%20Cddts/2025/6092_y25_sy.pdf\""
              },
              {
                "name": "Html",
                "value": "<img src=\"./polyatomicions/Periodic Table PNG 2023.png\" alt=\"Peroidic Table SEAB\"width=\"100%\" height=\"100%\">"
              },
              {
                "name": "Height",
                "value": "\"100vh\""
              },
              {
                "name": "Width",
                "value": "\"100%\""
              }
            ]
          }
        ]
      }
    ],
    "RootProperties": []
  },
  "metadata": {
    "APP": "WebEJS",
    "CreatedWith": "WebEJS : The web version of Easy JavaScript Simulations",
    "MoreInfo": "WebEJS 1.1",
    "version": "https://www.um.es/fem/wikis/webejs/"
  }
}