Made everything work

there are still infinite loops in the AIs