Use const for easier debugging
Added comments and fixed for loop in main