hashmap and bubblesort implementations