added controversialValue cloud code method and calculateStats to run both kdr and controversial