Renamed reversedList to stack