Changed list to stack