Implemented heartbeat, now working