implementing karam linked list