Under the law in California regarding security deposits, a landlord may deduct money for unpaid rent (including rent owed if the tenant does not give the landlord the proper notice that he or she is moving out).  I would speak with some one in your area on the proper calculation in your case.  Good luck.