small RPAM updates

changed return from N to n_p

line 66 might also need to be range(0…) not range(1…), unsure