updated to use HashMap so that when using threads reading data is not synchronized and therefore slower