Replaced outdated HashTable with HashMap

Also fixed other errors such as variable learning not existing.