Cleaned up code
Created more robust block definition; added heartbeat to server