Added basic logic for using linked list as a stack