506—Determination of Secured Status (section for secured claims).
(i)    (a)—the allowed secured claim is value of the debt or amount of the collateral, whichever is less. If there is not enough collateral to pay the whole debt, it is bifurcated into the secured claim and the allowed unsecured claim.  (Ex.  25,000 debt secured by prop that gives 24,000 post-expenses.  Creditor will have a $1000 unsecured claim.)
(ii)    (b)—a secured party can get post-pet interest and atty’s fees to the extent of the collateral if they have such fees.  (Note that only 2nd circuit allows claim for post-pet atty’s fees for unsecured or under-secured creditors.)
(iii)    (c)—trustee can recover from property securing an allowed secured claim the reasonable, necessary costs and expenses of preserving or disposing of, such property to the extent of any benefit to the holder of such claim.  (Ex.  If trustee sells stock that is subject to a SI, he can take the brokers fee off the top.)
(iv)    Note:  if SI is in collateral that is destroyed, creditor takes SI in insurance proceeds from collateral and remains fully secured.