replace custom linked list with a scala mutable.LinkedHashMap