rebuilding tools.py