replaced Memo's scala HashMaps with java HashMaps.