Added functionality to clear stack