everything in functions. now runs more stable. 12,0,0.0001,10000 works most times for initial curves close to (but not overlapping) black square