multiple any_pending methods to avoid saw tooth
latest script. needs cleaning up