import java.util.*;

/*
 * They begin by taking turns reading from a list of starting numbers (your puzzle input).
 * Then, each turn consists of considering the most recently spoken number:
 * 
 * If that was the first time the number has been spoken, the current player says 0.
 * Otherwise, the number had been spoken before; the current player announces how many turns
 * apart the number is from when it was previously spoken.
 */

public class Memory
{
    public Memory ()
    {
        _theMemory = new HashMap<Long, Number>();
        _turn = 0;
    }

    public Long speakNumber (Long numb)
    {
        _lastNumberSpoken = numb;
        _turn++;

        Number theNumber = _theMemory.get(numb);

        if (theNumber == null)
        theNumber = new Number(numb, count);
        else
            theNumber.spoken();;

        _theMemory.put(numb, theNumber);

        return theNumber.spokenTimes();
    }

    public boolean firstTimeSpoken (Long number)
    {
        Number numb = _theMemory.get(number);

        if (numb == null)
            return true;
        else
            return false;
    }

    public Long getNumberOfTimesSpoken (Long number)
    {
        Number numb = _theMemory.get(number);

        if (numb == null)
            return 0;
        else
            return numb.spokenTimes();
    }

    public Long getNextNumber (Long lastNumber)
    {
        return -1;
    }

    private HashMap<Long, Number> _theMemory;
    private Long _turn;
}
@@ -1034,32 +1034,52 @@
 f (numb == null)
+  // not spoken yet!
 %0A            ret
@@ -1124,13 +1124,33 @@
 urn 
-false
+(numb.spokenTimes() == 1)
 ;%0A  
@@ -1177,27 +1177,22 @@
  get
-NumberOfTimesSpoken
+TurnDifference
  (Lo
@@ -1340,27 +1340,30 @@
 rn numb.
-spokenTimes
+turnDifference
 ();%0A    

Update Memory.java