fixed implementation for gpp