minor changes plus finished cleaning up code after p-value calculation change.