public Map<String, Link> makeLinkMap(Map<String, Mass> massMap){

		Map<String, Link> linkMap = new HashMap<String, Link>();
		NodeList[] linkArray = {springs, muscles};

		for (NodeList linkType: linkArray){
			for (int i = 0; i < linkType.getLength(); i++) {
				Node node = linkType.item(i);

				if (node.getNodeType() == Node.ELEMENT_NODE) {
					Element element = (Element) node;

					String id1 = element.getAttribute("a");
					String id2 = element.getAttribute("b");
					double restLength = Double.parseDouble(element.getAttribute("restlength"));
					double k = getK(element, "contanst");


					if (element.getNodeName().equals("spring")){
						Spring spring = new Spring(massMap.get(id1), massMap.get(id2), restLength, k, springColor);
						linkMap.put("s"+id1+id2, spring);	
					}
					else{
						double amplitude = Double.parseDouble(element.getAttribute("amplitude"));
						Muscle muscle = new Muscle(massMap.get(id1), massMap.get(id2), restLength, k, amplitude, muscleColor);
						linkMap.put("m"+id1+id2, muscle);
					}
				}
			}
		}

		return linkMap;
	}