added another approach to q3