complete implentation, time to iron out bugs
averaging code was wrong... next bug?