gutted mysql stuff
basic set choosing logic