cleaning code and defining the ideas