Final working version, fixed bug for oversampling and added re-run code, also we can now choose how many frames we wish to sample.