moved while loop to prevent emptying stack in slot 1