Updated comments, variable names, added heartbeat