implementing gp model.