refactored ugly body mass energy js