Introduced toList() helper method to convert arrays of floats to lists of floats.