some docs for internal math and reasoning behind it