use 64bit int types to not lose precision in for loop counting variables