added iteration
removed useless console.log statements