#31 partial solution