Heartbeat code tested