improved some
got averaging working, perhaps