fairly bad attempt at a linkedlist implementation