Fixed complie errors and changed random seed generation