Programming Collective intelligence