started to build threading into the system. Currently hangs on acquiring write locks