Change output to be compatible with matlab