changed the algorithm a bit, and tested various videos