First question implemented using linkedhashmap