an incorrect implementation with linke list