refactored block method for computer class