crappy codes, bayesian_move needs debugging