some code for solving cue problems