cleaned up numerous unused var issues