Implemented code from N
Algorithms updated + HRV