Hadoc Reference Implementation