Prototype Spiroception code. Needs tidying and optimising: REALLY BADLY.