added health bar and slightly refactored block code