adding a magnitude function to Standard Functions