amended indentation and corrected close function
single indentation change