It’s hard to know if wearable devices give accurate sleep reports, so experts validated their own algorithm to score sleep using the Apple watch, reports Michigan Health Lab.

To get ahead of the outdated technology cycle, Goldstein and colleagues published a paper describing a new open-source algorithm that tracks slumber using heart rate and acceleration in the journal Sleep.

“We sent patients into the sleep laboratory for an overnight sleep study, wearing Apple watches, and used that data to develop our own algorithm to analyze acceleration and heart rate signal from the watch to estimate sleep,” she said.