Removed B copies.  Added in encoding routines for measuring distance traveled.