changing name which seemed to be causing problems and removing unused variables