finishing up heartbeat functionality