problem9 code