Fixed magnitude function again...