Got for loop working for iterating and printing inv