(concurring in dissent). I concur with the dissent, but would add that to hold, as does the majority, that the mere unlawful presence of a person in a building at the time *895he commits a crime is sufficient to constitute the crime of burglary is to eliminate the very element which distinguishes the crime of burglary from other crimes, viz., the unlawful entry with intent to commit a crime. Under the majority view, the crime of burglary was committed not at the time defendant gained unlawful entry, but at the time defendant committed the larceny while "remaining” unlawfully on the premises. Had the Legislature intended that result, it would have defined burglary as the commission of a crime while unlawfully upon the premises. The essence of the crime of burglary is not the commission of a crime while on the premises, but the unlawful entry with the intent to commit a crime (see, People v Boettcher, 20 AD2d 801). The intent must exist at the time of gaining entry (see, People v Hamilton, 18 AD2d 871) and it matters not whether a crime was thereafter committed (see, People v Mackey, 49 NY2d 274). The purpose of the burglary statutes is to deter persons from wrongfully entering buildings, either by an unlawful entry or, if the initial entry was with license or privilege, by scheming to remain unlawfully on the premises for the purpose of committing a crime. It is not intended to apply to criminal trespassers who, upon completion of that crime, thereafter decide to commit another crime. (Appeal from judgment of Supreme Court, Monroe County, Cornelius, J. — burglary, third degree; petit larceny.) Present — Doerr, J. P., Denman, Balio, Lawton and Davis, JJ.