complet implemented linked list without factoring the code in different files