Remvoed unnessassary loops