Add docs, iteration param and bug fix
K should be K-1 since that will be last last element of the array. It only noticed it go wrong when you pass in bad input like [0]
I added iterations to test out some of the -H param values