added (some kind of) solution for prob #5