general buildindex cleanup and added edge smoothing
merge edge + mismatch code