diff --git a/MathLib/Vector3.h b/MathLib/Vector3.h
index d3308f2dac6ca7f3a329037b7558764362e171c2..f8938cd4b5e9eed21cc0da61795102ab1e6cf30f 100644
--- a/MathLib/Vector3.h
+++ b/MathLib/Vector3.h
@@ -98,30 +98,6 @@ public:
 		return *this;
 	}
 
-	/** scalarProduct, implementation of scalar product,
-	 * sometimes called dot or inner product.
-	 */
-	template <typename T1>
-	friend T1 scalarProduct(TemplateVector3<T1> const& v, TemplateVector3<T1> const& w);
-
-	/** crossProduct: implementation of cross product,
-	 * sometimes called outer product.
-	 */
-	template <typename T1>
-	friend TemplateVector3<T1> crossProduct(
-		TemplateVector3<T1> const& v,
-		TemplateVector3<T1> const& w);
-
-	/**  multiplication with a scalar s */
-	template <typename T1>
-	friend 	TemplateVector3<T1> operator*(
-		TemplateVector3<T1> const& v,
-		double s);
-	template <typename T1>
-	friend 	TemplateVector3<T1> operator*(
-		double s,
-		TemplateVector3<T1> const& v);
-
 	TemplateVector3& operator*=(double s)
 	{
 		for (std::size_t i(0); i < 3; i++)
@@ -129,6 +105,20 @@ public:
 		return *this;
 	}
 
+	/// Comparison if equal
+	bool operator==(TemplateVector3 const& v) const
+	{
+		return std::fabs(this->_x[0] - v[0]) < sqrt(std::numeric_limits<double>::min()) &&
+			std::fabs(this->_x[1] - v[1]) < sqrt(std::numeric_limits<double>::min()) &&
+			std::fabs(this->_x[2] - v[2]) < sqrt(std::numeric_limits<double>::min());
+	}
+
+	/// Comparison if not equal
+	bool operator!=(const TemplateVector3 & v) const
+	{
+		return !(v == this);
+	}
+
 	/**
 	 * After applying the normalize operator to the vector its length is 1.0.
 	 */
@@ -145,19 +135,29 @@ public:
 		return sqrt(sqrLength());
 	}
 
-	/// Comparison if equal
-	bool operator==(TemplateVector3 const& v) const
-	{
-		return std::fabs(this->_x[0] - v[0]) < sqrt(std::numeric_limits<double>::min()) &&
-			std::fabs(this->_x[1] - v[1]) < sqrt(std::numeric_limits<double>::min()) &&
-			std::fabs(this->_x[2] - v[2]) < sqrt(std::numeric_limits<double>::min());
-	}
+	/** scalarProduct, implementation of scalar product,
+	 * sometimes called dot or inner product.
+	 */
+	template <typename T1>
+	friend T1 scalarProduct(TemplateVector3<T1> const& v, TemplateVector3<T1> const& w);
 
-	/// Comparison if not equal
-	bool operator!=(const TemplateVector3 & v) const
-	{
-		return !(v == this);
-	}
+	/** crossProduct: implementation of cross product,
+	 * sometimes called outer product.
+	 */
+	template <typename T1>
+	friend TemplateVector3<T1> crossProduct(
+		TemplateVector3<T1> const& v,
+		TemplateVector3<T1> const& w);
+
+	/**  multiplication with a scalar s */
+	template <typename T1>
+	friend 	TemplateVector3<T1> operator*(
+		TemplateVector3<T1> const& v,
+		double s);
+	template <typename T1>
+	friend 	TemplateVector3<T1> operator*(
+		double s,
+		TemplateVector3<T1> const& v);
 
 private:
 	/// Returns the squared length