Fix G value calculating

Signed-off-by: Igor Yeromin <yeryomin.igor@gmail.com>