fixing array smallest to return the correct number