modified scgen and docs