code before clean up