up to problem 1021