trying produce a sorting function for float type array