- comments added, for loop refactored