(Done) already combined thses two loop into one