Fix bugs and add random moves