cleaning up tools.py going to work more on it later