factored out an averaging function
finished implementing RANSAC error correction algorithm for translation