some unused variables removed