fixed bug in sorting
changed to sort on p-value
fixed error in output formatting