Add an progress message (every 1000th iteration) and fix the indexing when given an array of positions.