added gengen, fixed size calculation