rewrite from scratch using Fisica engine