Removed potential threading - now compiles.
Will get stuck in endless loop at the moment!