finished generate chain(I hope)