Add documentation of heartbeat() function to readme