Works without bugs but still problems with hashmap.