Added code to do Yn tallying with NDPP and also cleaned up some write statements left behind from the last commit.