Adding if loop