create setF and getNextP method