fixed output and added p-value computation