lots of new software for tracking, etc, and also added structure initialisation code