both of your functions are calculating against $p.
if $p is omitted from the input, does your code still work?

thinking about it again, my code might be doing something alike...
need to see once I get to that computer.


Edited by Lonkero (2018-07-09 11:30 PM)
_________________________
!

download KiXnet