Added dynamic timing so the sort goes faster the less work that needs to be done