Added code to calculate recommendations.