Initial setup for Loop Invariant
final code for Loop Invariant