fix errors in add that would cause a deadlock, better testing, stats now returns struct