insert_sort modified to less than or equal fixing Pidle calculation. Output can now be csv