This is starting to work, but there seems to be some strange with mutexes every once in a while, grr!