Simple solution from programming task