Started adding tools.trace. Realized that something very fundamental is broken. Started trying to debug it, but haven't really gotten anywhere