Added toroidal mode. Also moved distance calculation to Creature class