implementation of naive hps