Implementation of linkedList