overflow bug fixed, now it just returns inf