still have stuff here to do
now has working alignment distance functions ... but poorly tested
made some more changes. Still needs better testing