Adding in a summary
changing name which seemed to be causing problems and removing unused variables