updated GP code