mem leak fixed on hw7