improved quota stats script