Added heartbeat struct.
Made the heartbeat immutable.
Started using the heartbeat struct.