pretty much ready to freeze code

some checks were added to ensure proper input processing and ouput as
well as computations for averages and such were improved