the previous commit had a bug, this fixes it
	modified:   tools.py