iteration solution
dummy head solution