refactor to enable reuse.
add docstring
armodel was misnamed. mov_avg performs a moving average filter on stdin