Refactored the stack header to use an actual head node instead of a dummy node