weird things happening with work count. random hangs. my machine or the code?