The for loops work just fine! The issue arises at temp part... "number(k) now found". how to solve this.