fixed replace function in linkedlist.java