code from the peaks group