achileshbc: you can introduce one more array to remember the order of each myarray index, ie. order(counter) = num and then loop through this array instead of For Looping 1 to 90. myarray could be Boolean.