cleaning the intro code with some functions. in progress