Fixing off by one with the last loop example. Replaced output with new output with the fixed loop maximum.