Fixed finishing code so does not require input for each iteration
format change
Added prioritisation stuff, implemented sparse sampling