Added files where stats algorithms will be.
Corrected some bugs, implemented stats.