cleaned up code, implemented simple statistics measures, derivative statistics measures including RPI, MV, and others