Homework program5 by IvailoIvanov