Leonard Lambert's commercial building, which had an adjusted basis of $500,000, was partially destroyed by fire. The fair market value was $800,000 just before the fire and $600,000 immediately after. Leonard received $150,000 insurance proceeds and deducted a $50,000 casualty loss. What is Leonard's basis in the building before any repairs are made?