Almost finished code (w/ heartrate and RR interval)