fixed left-hand averaging problem; averaging working ok now
started adding code to detect whether sufficient motion