Moving physics to separate js file