fixed the code for selecting odd numbers in array