Improved MPNS code #47