finally maxpr is solved...but func is still failing.