complete statistics calculation