trying to optimize line drawing of the waves