changed implementation of stage 1 functions to linked lists
test01 now works correctly
seg fault is gone