changed exception, writing tests for hashmap