Move calculation function to module
Inadvertant trippiness
Fix ping effect