Dev branch working

Ball movement stops if the document looses focus. Stable and working.