made diameter a global constant