The listening algorithm