motion tracking code by kyle hounslow