pgm 22.13, input val rationalized and bullet proofed