calculating magnitudo with SSE