Implemented average calculations for topic