Added code for restricting the analysis to a certain range of frames