optimizing goniometer moves