might want to add a warning here that this mutates the supplied array 'from'