(define (make-account balance secret-password)
  (define (incorrect-password . args) "Incorrect password")
  (define (withdraw amount)
    (if (>= balance amount)
        (begin (set! balance (- balance amount)) balance)
        "Insufficient funds"))
  (define (deposit amount)
    (set! balance (+ balance amount)) balance)
  (define (dispatch password method)
    (if (eq? secret-password password)
      (cond ((eq? method 'withdraw) withdraw)
            ((eq? method 'deposit) deposit)
            (else (error "Unknown request -- MAKE-ACCOUNT" m)))
      incorrect-password))
  dispatch)


(define (make-account balance secret-password)
  (define (incorrect-password . args) "Incorrect password")
  (define (withdraw amount)
    (if (>= balance amount)
        (begin (set! balance (- balance amount)) balance)
        "Insufficient funds"))
  (define (deposit amount)
    (set! balance (+ balance amount)) balance)
  (define (dispatch password method)
    (if (eq? secret-password password)
      (cond ((eq? method 'withdraw) withdraw)
            ((eq? method 'deposit) deposit)
            (else (error "Unknown request -- MAKE-ACCOUNT" m)))
      incorrect-password))
  dispatch)

