calculating various statistics for merchants project