Per-Frame Algorithm