Scripts used for dealing with motion output