Fixed the logical error where it was adding the n value to all of them. I had removed the if statement to only do it to the false values and not the true ones. It is working now.