Replaced array lists with hash tables
minor changes