tested and cleaned up perl statistics scripts