public void viterbi()
	{
		int t = 0; //time seq
		
		//initialize each state at t=0 to the initial probability
		HashMap<String, Node> ppaths = new HashMap<String, Node>();
		for (String state : states)
		{
			ppaths.put(state, new Node(state, null, initial_probability.get(state)));
		}
		
		
		//forward compute
		for (String e : observations)  //for each observation in order of time t
		{
			//System.out.println("OBS: " + e + " T: " + t);
			HashMap<String, Node> nppaths = new HashMap<String, Node>();
			
			for (String tostate : states) //for each possible state that we can go TO
			{
				//System.out.println("TOSTATE: " + tostate);
				
				
				Double myprob =1d;				
				Node nn = new Node(null, null, 0d);
				
				for (Node fromstate : ppaths.values())
				{
					//System.out.println("FROMSTATE: " + fromstate.state);
					
					myprob = fromstate.probability;
					
					Double predict = transitionModel.get(fromstate.state).get(tostate);
					Double update = sensorModel.get(tostate).get(e); ///TODO: should this be tostate? OMG IT SHOULD
					
					if (t==0) predict=1d; //on the 0th step we don't have sensor information
					
					Double both = predict*update;
					
					//System.out.println(myprob + " * "+predict+" * " + update + " = " + myprob * predict * update);
					
					myprob *= both;
					
					nn.updateMax(tostate, fromstate, myprob);
					if (t==0) nn.parent=null; //if we're at zero make sure no parent
				}
				nppaths.put(tostate, nn);
										
			}
			if (t==0) normalize(nppaths); // normalize the first step ignore the rest
			System.out.println(nppaths);
			ppaths = nppaths;
			t++;
		}
		
		
		//choose
		if (t==observations.length)
		{
			System.out.println("most probable sequence:");
			Node max = new Node(null, null, 0d);
			for (String state : states)
			{
				Node from = ppaths.get(state);
				max.updateMax(from.state, from.parent, from.probability);
			}
			System.out.println(max);
		}
		
	}