made some scaffolding changes to the original