remove unused and undeclared method invocation
add comment block and move improper variable initialization inside iterations