preference logic built and working