KMP and casting on malloc
Resampling