keepnick.py: script optimized