ex3.01 another solution