Trying out a pretty sloppy recursive algorithm instead for the AI