updated Josh's pedestrian detection algorithm