After running the application in de-bug the error seems to be on line 20 where I set the minimum value to array[0]. Instead of setting this value it seems to make it equal zero every time! Any idea of how I can change this?