New documentation with errorFunction addition