core recommendation code