Final version with documentation