Thankyou heaps man i understand so much more than i did before ur post but theres 1 thing i cant get right
i was deskchecking using this array
elements[21,6,5,4,40]
and so when i pass through, i notice i am setting the variable maxval to element(index), which using my array would be "21". So...