Fixed Major mistake in Magnitude calculation