Created new file for statistics routines. Editied associated files to
use the new functions.