refactored hear rate and cadence function to return multiple values