Adding first code for heartbeating. Way more needed till we are done.