Problem 40 alternative added