Added linkedList algorithm