Adding stack datastructure, fixing bugs in linked list