solved problem F