working version of genlog