initial commit (tools.py not in working condition)