doesnt crash on infinity calculation, but still needs work