Problem5 improved, thx viata