started implementing calculate stats