fps: simplified the logic. Added debug prints. Fine tuned limits.