Algorithm refactor to improve performance, only calculate status for cell which status maybe change.
Add random generate cell function.