it was not difficult for heidi to quickly gain their confidence and although she hated having to abuse this confidence , it was through them that she discovered which apartment he lived in and also the means to gain access by acquiring a copy of his key .